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.

30 lines
888 B

  1. ---
  2. - name: "Test if network plugin is defined"
  3. fail: msg="ERROR, One network_plugin variable must be defined (Flannel or Calico)"
  4. when: ( kube_network_plugin is defined and kube_network_plugin == "calico" and kube_network_plugin == "flannel" ) or
  5. kube_network_plugin is not defined
  6. - include: flannel.yml
  7. when: kube_network_plugin == "flannel"
  8. - name: Set docker daemon options
  9. template:
  10. src: docker
  11. dest: "{{ '/etc/sysconfig/docker-network' if ansible_os_family == 'RedHat' else '/etc/default/docker' }}"
  12. owner: root
  13. group: root
  14. mode: 0644
  15. notify:
  16. - restart docker
  17. - name: Write docker.service systemd file
  18. template:
  19. src: systemd-docker.service
  20. dest: /lib/systemd/system/docker.service
  21. notify: restart docker
  22. when: init_system == "systemd"
  23. - meta: flush_handlers
  24. - include: calico.yml
  25. when: kube_network_plugin == "calico"