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.

68 lines
2.7 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 | stop controller
  8. - Preinstall | pause for controller
  9. - Preinstall | restart controller
  10. when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  11. # FIXME(bogdando) https://github.com/projectcalico/felix/issues/1185
  12. - name: Preinstall | reload network
  13. service:
  14. name: >-
  15. {% if ansible_os_family == "RedHat" -%}
  16. network
  17. {%- elif ansible_os_family == "Debian" -%}
  18. networking
  19. {%- endif %}
  20. state: restarted
  21. when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] and kube_network_plugin not in ['canal', 'calico']
  22. - name: Preinstall | update resolvconf for Container Linux by CoreOS
  23. command: /bin/true
  24. notify:
  25. - Preinstall | apply resolvconf cloud-init
  26. - Preinstall | reload kubelet
  27. when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  28. - name: Preinstall | apply resolvconf cloud-init
  29. command: /usr/bin/coreos-cloudinit --from-file {{ resolveconf_cloud_init_conf }}
  30. when: ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  31. - name: Preinstall | reload kubelet
  32. service:
  33. name: kubelet
  34. state: restarted
  35. notify:
  36. - Preinstall | kube-controller configured
  37. - Preinstall | stop controller
  38. - Preinstall | pause for controller
  39. - Preinstall | restart controller
  40. when: inventory_hostname in groups['kube-master'] and not dns_early|bool
  41. - name: Preinstall | kube-controller configured
  42. stat: path="{{ kube_manifest_dir }}/kube-controller-manager.manifest"
  43. register: kube_controller_set
  44. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'
  45. - name: Preinstall | stop controller
  46. replace:
  47. dest: "{{ kube_manifest_dir }}/kube-controller-manager.manifest"
  48. regexp: '(\s+)image:\s+.*?$'
  49. replace: '\1image: kill.controller.using.fake.image.in:manifest'
  50. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf' and kube_controller_set.stat.exists
  51. - name: Preinstall | pause for controller
  52. pause: seconds=20
  53. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf' and kube_controller_set.stat.exists
  54. - name: Preinstall | restart controller
  55. replace:
  56. dest: "{{ kube_manifest_dir }}/kube-controller-manager.manifest"
  57. regexp: '(\s+)image:\s+.*?$'
  58. replace: '\1image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}'
  59. when: inventory_hostname in groups['kube-master'] and dns_mode != 'none' and resolvconf_mode == 'host_resolvconf' and kube_controller_set.stat.exists