2016-12-09 00:48:54 +08:00
|
|
|
---
|
2019-08-08 22:37:22 +08:00
|
|
|
- name: Calico-rr | Pre-upgrade tasks
|
|
|
|
include_tasks: pre.yml
|
2016-12-09 00:48:54 +08:00
|
|
|
|
2019-08-08 22:37:22 +08:00
|
|
|
- name: Calico-rr | Fetch current node object
|
|
|
|
command: "{{ bin_dir }}/calicoctl.sh get node {{ inventory_hostname }} -oyaml"
|
|
|
|
register: calico_rr_node
|
2016-12-09 00:48:54 +08:00
|
|
|
|
2019-08-08 22:37:22 +08:00
|
|
|
# FIXME(mattymo): Use jsonpatch when ansible/ansible#52931 is merged
|
|
|
|
- name: Calico-rr | Set route reflector cluster ID
|
|
|
|
shell: >-
|
|
|
|
echo -e '{{ calico_rr_node.stdout }}' |
|
|
|
|
sed '/bgp:/a \ \ \ \ routeReflectorClusterID: {{ cluster_id }}'
|
|
|
|
register: calico_rr_node
|
|
|
|
when: '("routeReflectorClusterID: " + cluster_id|string) not in calico_rr_node.stdout_lines'
|
2016-12-09 00:48:54 +08:00
|
|
|
|
|
|
|
- name: Calico-rr | Configure route reflector
|
2019-08-08 22:37:22 +08:00
|
|
|
shell: |-
|
|
|
|
echo -e '{{ calico_rr_node.stdout }}' |
|
|
|
|
{{ bin_dir }}/calicoctl.sh replace -f-
|
2018-09-19 22:22:52 +08:00
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
2016-12-09 00:48:54 +08:00
|
|
|
|
2019-08-08 22:37:22 +08: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
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|