diff --git a/cluster.yml b/cluster.yml index bdaced1ae..64535a5a0 100644 --- a/cluster.yml +++ b/cluster.yml @@ -57,6 +57,12 @@ - { role: kargo-defaults} - { role: vault, tags: vault, when: "cert_management == 'vault'"} +- hosts: calico-rr + any_errors_fatal: "{{ any_errors_fatal | default(true) }}" + roles: + - { role: kargo-defaults} + - { role: network_plugin/calico/rr, tags: network } + - hosts: k8s-cluster any_errors_fatal: "{{ any_errors_fatal | default(true) }}" roles: @@ -72,12 +78,6 @@ - { role: kubernetes-apps/network_plugin, tags: network } - { role: kubernetes-apps/policy_controller, tags: policy-controller } -- hosts: calico-rr - any_errors_fatal: "{{ any_errors_fatal | default(true) }}" - roles: - - { role: kargo-defaults} - - { role: network_plugin/calico/rr, tags: network } - - hosts: k8s-cluster any_errors_fatal: "{{ any_errors_fatal | default(true) }}" roles: diff --git a/roles/network_plugin/calico/tasks/main.yml b/roles/network_plugin/calico/tasks/main.yml index 06c987b57..b9f8fb22d 100644 --- a/roles/network_plugin/calico/tasks/main.yml +++ b/roles/network_plugin/calico/tasks/main.yml @@ -233,7 +233,7 @@ "metadata": { "node": "{{ inventory_hostname.split(".")[0] }}", "scope": "node", - "peerIP": "{{ hostvars[item]["calico_rr_ip"] | default(hostvars[item]["ip"]) | default(hostvars[item]["ansible_default_ipv4"]["address"]) }}" + "peerIP": "{{ hostvars[item]["rr_ip"] }}" } }' | {{ bin_dir }}/calicoctl create --skip-exists -f - @@ -256,7 +256,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']) | default(hostvars[item]['ansible_default_ipv4']['address']) }} as {{ local_as | default(global_as_num) }}" + shell: "{{ bin_dir }}/calicoctl node bgp peer add {{ hostvars[item]['rr_ip'] }} 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']