|
@ -163,14 +163,13 @@ |
|
|
shell: > |
|
|
shell: > |
|
|
echo '{ |
|
|
echo '{ |
|
|
"apiVersion": "projectcalico.org/v3", |
|
|
"apiVersion": "projectcalico.org/v3", |
|
|
"kind": "bgpPeer", |
|
|
|
|
|
|
|
|
"kind": "BGPPeer", |
|
|
"metadata": { |
|
|
"metadata": { |
|
|
"name": "{{ inventory_hostname }}-bgp" |
|
|
|
|
|
|
|
|
"name": "{{ inventory_hostname }}-{{ item.router_id }}" |
|
|
}, |
|
|
}, |
|
|
"spec": { |
|
|
"spec": { |
|
|
"asNumber": "{{ item.as }}", |
|
|
"asNumber": "{{ item.as }}", |
|
|
"node": "{{ inventory_hostname }}", |
|
|
"node": "{{ inventory_hostname }}", |
|
|
"scope": "node", |
|
|
|
|
|
"peerIP": "{{ item.router_id }}" |
|
|
"peerIP": "{{ item.router_id }}" |
|
|
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f - |
|
|
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f - |
|
|
retries: 4 |
|
|
retries: 4 |
|
@ -203,13 +202,12 @@ |
|
|
shell: > |
|
|
shell: > |
|
|
echo '{ |
|
|
echo '{ |
|
|
"apiVersion": "projectcalico.org/v3", |
|
|
"apiVersion": "projectcalico.org/v3", |
|
|
"kind": "bgpPeer", |
|
|
|
|
|
|
|
|
"kind": "BGPPeer", |
|
|
"metadata": { |
|
|
"metadata": { |
|
|
"name": "{{ inventory_hostname }}" |
|
|
|
|
|
|
|
|
"name": "{{ inventory_hostname }}-{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" |
|
|
}, |
|
|
}, |
|
|
"spec": { |
|
|
"spec": { |
|
|
"asNumber": "{{ local_as | default(global_as_num)}}", |
|
|
"asNumber": "{{ local_as | default(global_as_num)}}", |
|
|
"scope": "node", |
|
|
|
|
|
"node": "{{ inventory_hostname }}", |
|
|
"node": "{{ inventory_hostname }}", |
|
|
"peerIP": "{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" |
|
|
"peerIP": "{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" |
|
|
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f - |
|
|
}}' | {{ bin_dir }}/calicoctl create --skip-exists -f - |
|
|