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.

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