mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-28 22:35:12 -02:30
Test group membership with group_names
Testing for group membership with group names makes Kubespray more tolerant towards the structure of the inventory. Where 'inventory_hostname in groups["some_group"] would fail if "some_group" is not defined, '"some_group" in group_names' would not.
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
{% endfor %}]"
|
||||
delegate_to: "{{ groups['etcd'][0] }}"
|
||||
when:
|
||||
- inventory_hostname in groups['etcd']
|
||||
- ('etcd' in group_names)
|
||||
- sync_certs | default(false)
|
||||
- inventory_hostname != groups['etcd'][0]
|
||||
notify: Set etcd_secret_changed
|
||||
@@ -93,7 +93,7 @@
|
||||
mode: "0640"
|
||||
with_items: "{{ etcd_master_certs.results }}"
|
||||
when:
|
||||
- inventory_hostname in groups['etcd']
|
||||
- ('etcd' in group_names)
|
||||
- sync_certs | default(false)
|
||||
- inventory_hostname != groups['etcd'][0]
|
||||
loop_control:
|
||||
@@ -110,7 +110,7 @@
|
||||
{% endfor %}]"
|
||||
delegate_to: "{{ groups['etcd'][0] }}"
|
||||
when:
|
||||
- inventory_hostname in groups['etcd']
|
||||
- ('etcd' in group_names)
|
||||
- inventory_hostname != groups['etcd'][0]
|
||||
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
|
||||
- kube_network_plugin != "calico" or calico_datastore == "etcd"
|
||||
@@ -125,7 +125,7 @@
|
||||
mode: "0640"
|
||||
with_items: "{{ etcd_master_node_certs.results }}"
|
||||
when:
|
||||
- inventory_hostname in groups['etcd']
|
||||
- ('etcd' in group_names)
|
||||
- inventory_hostname != groups['etcd'][0]
|
||||
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
|
||||
- kube_network_plugin != "calico" or calico_datastore == "etcd"
|
||||
@@ -135,7 +135,7 @@
|
||||
- name: Gen_certs | Generate etcd certs
|
||||
include_tasks: gen_nodes_certs_script.yml
|
||||
when:
|
||||
- inventory_hostname in groups['kube_control_plane'] and
|
||||
- ('kube_control_plane' in group_names) and
|
||||
sync_certs | default(false) and inventory_hostname not in groups['etcd']
|
||||
|
||||
- name: Gen_certs | Generate etcd certs on nodes if needed
|
||||
@@ -143,7 +143,7 @@
|
||||
when:
|
||||
- kube_network_plugin in ["calico", "flannel", "cilium"] or cilium_deploy_additionally | default(false) | bool
|
||||
- kube_network_plugin != "calico" or calico_datastore == "etcd"
|
||||
- inventory_hostname in groups['k8s_cluster'] and
|
||||
- ('k8s_cluster' in group_names) and
|
||||
sync_certs | default(false) and inventory_hostname not in groups['etcd']
|
||||
|
||||
- name: Gen_certs | check certificate permissions
|
||||
|
||||
Reference in New Issue
Block a user