2017-08-24 09:09:52 +00:00
---
2019-11-06 18:11:52 +00:00
- name : Preinstall | propagate resolvconf to k8s components
2016-08-29 14:39:55 +00:00
command : /bin/true
notify :
2016-11-30 13:06:11 +00:00
- Preinstall | reload kubelet
2017-02-01 04:31:57 +00:00
- Preinstall | kube-controller configured
2018-01-30 21:26:07 +00:00
- Preinstall | kube-apiserver configured
2019-10-17 01:58:39 +00:00
- Preinstall | restart kube-controller-manager docker
- Preinstall | restart kube-controller-manager crio/containerd
- Preinstall | restart kube-apiserver docker
- Preinstall | restart kube-apiserver crio/containerd
2020-05-28 15:02:02 +00:00
when : not ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"] and not is_fedora_coreos
2016-08-29 14:39:55 +00:00
2020-02-18 08:15:29 +00:00
- name : Preinstall | update resolvconf for Container Linux by CoreOS and Flatcar
2016-11-23 14:49:10 +00:00
command : /bin/true
notify :
2016-12-07 15:57:05 +00:00
- Preinstall | apply resolvconf cloud-init
- Preinstall | reload kubelet
2020-05-28 15:02:02 +00:00
when : ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos
2016-09-27 09:54:12 +00:00
2016-12-07 15:57:05 +00:00
- name : Preinstall | apply resolvconf cloud-init
2016-11-23 14:49:10 +00:00
command : /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
2020-05-28 15:02:02 +00:00
when : ansible_os_family in ["CoreOS", "Coreos", "Container Linux by CoreOS", "Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos
2016-11-23 14:49:10 +00:00
2016-12-07 15:57:05 +00:00
- name : Preinstall | reload kubelet
2016-09-27 09:54:12 +00:00
service :
name : kubelet
state : restarted
2017-02-01 04:31:57 +00:00
notify :
- Preinstall | kube-controller configured
2018-01-30 21:26:07 +00:00
- Preinstall | kube-apiserver configured
2019-10-17 01:58:39 +00:00
- Preinstall | restart kube-controller-manager docker
- Preinstall | restart kube-controller-manager crio/containerd
- Preinstall | restart kube-apiserver docker
- Preinstall | restart kube-apiserver crio/containerd
2017-04-04 17:43:47 +00:00
when : not dns_early|bool
2017-02-01 04:31:57 +00:00
2018-01-30 21:26:07 +00:00
# FIXME(mattymo): Also restart for kubeadm mode
- name : Preinstall | kube-apiserver configured
stat : path="{{ kube_manifest_dir }}/kube-apiserver.manifest"
register : kube_apiserver_set
when : inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
# FIXME(mattymo): Also restart for kubeadm mode
2017-02-01 04:31:57 +00:00
- name : Preinstall | kube-controller configured
stat : path="{{ kube_manifest_dir }}/kube-controller-manager.manifest"
register : kube_controller_set
when : inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
2019-10-17 01:58:39 +00:00
- name : Preinstall | restart kube-controller-manager docker
2018-01-30 21:26:07 +00:00
shell : "docker ps -f name=k8s_POD_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
2019-10-17 01:58:39 +00:00
when :
- container_manager == "docker"
- inventory_hostname in groups['kube-master']
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- kube_controller_set.stat.exists
2018-01-30 21:26:07 +00:00
2019-10-17 01:58:39 +00:00
- name : Preinstall | restart kube-controller-manager crio/containerd
shell : crictl pods --name kube-controller-manager* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
when :
- container_manager in ['crio', 'containerd']
- inventory_hostname in groups['kube-master']
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- kube_controller_set.stat.exists
- name : Preinstall | restart kube-apiserver docker
2018-01-30 21:26:07 +00:00
shell : "docker ps -f name=k8s_POD_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
2019-10-17 01:58:39 +00:00
when :
- container_manager == "docker"
- inventory_hostname in groups['kube-master']
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- name : Preinstall | restart kube-apiserver crio/containerd
shell : crictl pods --name kube-apiserver* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
when :
- container_manager in ['crio', 'containerd']
- inventory_hostname in groups['kube-master']
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
2019-11-06 11:33:52 +00:00
- name : Preinstall | Restart systemd-resolved
service :
name : systemd-resolved
state : restarted