mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
Rework inventory all by real groups' vars
* Leave all.yml to keep only optional vars * Store groups' specific vars by existing group names * Fix optional vars casted as mandatory (add default()) * Fix missing defaults for an optional IP var * Relink group_vars for terraform to reflect changes Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>
This commit is contained in:
@@ -223,7 +223,7 @@
|
||||
"apiVersion": "v1",
|
||||
"metadata": {"node": "{{ inventory_hostname }}",
|
||||
"scope": "node",
|
||||
"peerIP": "{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"]) }}"}
|
||||
"peerIP": "{{ hostvars[item]["calico_rr_ip"]|default(hostvars[item]["ip"])|default(hostvars[item]["ansible_default_ipv4.address"]) }}"}
|
||||
}'
|
||||
| {{ bin_dir }}/calicoctl create --skip-exists -f -
|
||||
with_items: "{{ groups['calico-rr'] | default([]) }}"
|
||||
@@ -245,7 +245,7 @@
|
||||
peer_with_router|default(false) and inventory_hostname in groups['k8s-cluster'])
|
||||
|
||||
- name: Calico (old) | Configure peering with route reflectors
|
||||
shell: "{{ bin_dir }}/calicoctl node bgp peer add {{ hostvars[item]['calico_rr_ip']|default(hostvars[item]['ip']) }} as {{ local_as | default(global_as_num) }}"
|
||||
shell: "{{ bin_dir }}/calicoctl node bgp peer add {{ hostvars[item]['calico_rr_ip']|default(hostvars[item]['ip'])|default(hostvars[item]['ansible_default_ipv4.address']) }} as {{ local_as | default(global_as_num) }}"
|
||||
with_items: "{{ groups['calico-rr'] | default([]) }}"
|
||||
when: (legacy_calicoctl and
|
||||
peer_with_calico_rr|default(false) and inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
Reference in New Issue
Block a user