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.

49 lines
1.9 KiB

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