2016-12-08 16:48:54 +00:00
|
|
|
---
|
2019-08-08 14:37:22 +00:00
|
|
|
- name: Calico-rr | Pre-upgrade tasks
|
|
|
|
include_tasks: pre.yml
|
2016-12-08 16:48:54 +00:00
|
|
|
|
2019-08-08 14:37:22 +00:00
|
|
|
- name: Calico-rr | Fetch current node object
|
2019-08-27 17:16:42 +00:00
|
|
|
command: "{{ bin_dir }}/calicoctl.sh get node {{ inventory_hostname }} -ojson"
|
2019-08-08 14:37:22 +00:00
|
|
|
register: calico_rr_node
|
2019-08-27 17:16:42 +00:00
|
|
|
until: calico_rr_node is succeeded
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
retries: 10
|
2016-12-08 16:48:54 +00:00
|
|
|
|
2019-08-08 14:37:22 +00:00
|
|
|
- name: Calico-rr | Set route reflector cluster ID
|
2019-08-27 17:16:42 +00:00
|
|
|
set_fact:
|
|
|
|
calico_rr_node_patched: >-
|
|
|
|
{{ calico_rr_node.stdout | from_json | combine({ 'spec': { 'bgp':
|
|
|
|
{ 'routeReflectorClusterID': cluster_id }}}, recursive=True) }}
|
2016-12-08 16:48:54 +00:00
|
|
|
|
|
|
|
- name: Calico-rr | Configure route reflector
|
2019-08-27 17:16:42 +00:00
|
|
|
shell: "{{ bin_dir }}/calicoctl.sh replace -f-"
|
|
|
|
args:
|
|
|
|
stdin: "{{ calico_rr_node_patched | to_json }}"
|
2016-12-08 16:48:54 +00:00
|
|
|
|
2019-08-08 14:37:22 +00:00
|
|
|
- name: Calico-rr | Set label for route reflector
|
|
|
|
command: >-
|
|
|
|
{{ bin_dir }}/calicoctl.sh label node {{ inventory_hostname }}
|
|
|
|
'i-am-a-route-reflector=true' --overwrite
|