You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.7 KiB

  1. ---
  2. - name: Preinstall | restart network
  3. command: /bin/true
  4. notify:
  5. - Preinstall | reload network
  6. - Preinstall | reload kubelet
  7. - Preinstall | kube-controller configured
  8. - Preinstall | kube-apiserver configured
  9. - Preinstall | restart kube-controller-manager
  10. - Preinstall | restart kube-apiserver
  11. when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  12. # FIXME(bogdando) https://github.com/projectcalico/felix/issues/1185
  13. - name: Preinstall | reload network
  14. service:
  15. name: >-
  16. {% if ansible_os_family == "RedHat" -%}
  17. network
  18. {%- elif ansible_os_family == "Debian" -%}
  19. networking
  20. {%- endif %}
  21. state: restarted
  22. when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] and kube_network_plugin not in ['canal', 'calico']
  23. - name: Preinstall | update resolvconf for Container Linux by CoreOS
  24. command: /bin/true
  25. notify:
  26. - Preinstall | apply resolvconf cloud-init
  27. - Preinstall | reload kubelet
  28. when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  29. - name: Preinstall | apply resolvconf cloud-init
  30. command: /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
  31. when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  32. - name: Preinstall | reload kubelet
  33. service:
  34. name: kubelet
  35. state: restarted
  36. notify:
  37. - Preinstall | kube-controller configured
  38. - Preinstall | kube-apiserver configured
  39. - Preinstall | restart kube-controller-manager
  40. - Preinstall | restart kube-apiserver
  41. when: not dns_early|bool
  42. # FIXME(mattymo): Also restart for kubeadm mode
  43. - name: Preinstall | kube-apiserver configured
  44. stat: path="{{ kube_manifest_dir }}/kube-apiserver.manifest"
  45. register: kube_apiserver_set
  46. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
  47. # FIXME(mattymo): Also restart for kubeadm mode
  48. - name: Preinstall | kube-controller configured
  49. stat: path="{{ kube_manifest_dir }}/kube-controller-manager.manifest"
  50. register: kube_controller_set
  51. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
  52. - name: Preinstall | restart kube-controller-manager
  53. shell: "docker ps -f name=k8s_POD_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f"
  54. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf' and kube_controller_set.stat.exists
  55. - name: Preinstall | restart kube-apiserver
  56. shell: "docker ps -f name=k8s_POD_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f"
  57. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'