mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-10 20:29:18 +03:00
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:
@@ -35,7 +35,7 @@
|
||||
get_checksum: false
|
||||
get_mime: false
|
||||
register: kube_apiserver_set
|
||||
when: inventory_hostname in groups['kube_control_plane'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
||||
when: ('kube_control_plane' in group_names) and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
||||
listen: Preinstall | propagate resolvconf to k8s components
|
||||
|
||||
# FIXME(mattymo): Also restart for kubeadm mode
|
||||
@@ -46,7 +46,7 @@
|
||||
get_checksum: false
|
||||
get_mime: false
|
||||
register: kube_controller_set
|
||||
when: inventory_hostname in groups['kube_control_plane'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
||||
when: ('kube_control_plane' in group_names) and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
|
||||
listen: Preinstall | propagate resolvconf to k8s components
|
||||
|
||||
- name: Preinstall | restart kube-controller-manager docker
|
||||
@@ -55,7 +55,7 @@
|
||||
executable: /bin/bash
|
||||
when:
|
||||
- container_manager == "docker"
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- dns_mode != 'none'
|
||||
- resolvconf_mode == 'host_resolvconf'
|
||||
- kube_controller_set.stat.exists
|
||||
@@ -71,7 +71,7 @@
|
||||
until: preinstall_restart_controller_manager.rc == 0
|
||||
when:
|
||||
- container_manager in ['crio', 'containerd']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- dns_mode != 'none'
|
||||
- resolvconf_mode == 'host_resolvconf'
|
||||
- kube_controller_set.stat.exists
|
||||
@@ -83,7 +83,7 @@
|
||||
executable: /bin/bash
|
||||
when:
|
||||
- container_manager == "docker"
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- dns_mode != 'none'
|
||||
- resolvconf_mode == 'host_resolvconf'
|
||||
- kube_apiserver_set.stat.exists
|
||||
@@ -99,7 +99,7 @@
|
||||
delay: 1
|
||||
when:
|
||||
- container_manager in ['crio', 'containerd']
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- dns_mode != 'none'
|
||||
- resolvconf_mode == 'host_resolvconf'
|
||||
- kube_apiserver_set.stat.exists
|
||||
@@ -116,7 +116,7 @@
|
||||
delay: 1
|
||||
when:
|
||||
- dns_late
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
- ('kube_control_plane' in group_names)
|
||||
- dns_mode != 'none'
|
||||
- resolvconf_mode == 'host_resolvconf'
|
||||
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
|
||||
|
||||
Reference in New Issue
Block a user