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.

52 lines
1.3 KiB

9 years ago
9 years ago
9 years ago
9 years ago
  1. ---
  2. - name: Flannel | Write flannel configuration
  3. template:
  4. src: network.json
  5. dest: /etc/flannel-network.json
  6. backup: yes
  7. - name: Flannel | Create flannel pod manifest
  8. template:
  9. src: flannel-pod.yml
  10. dest: /etc/kubernetes/manifests/flannel-pod.manifest
  11. notify: delete default docker bridge
  12. - name: Flannel | Wait for flannel subnet.env file presence
  13. wait_for:
  14. path: /run/flannel/subnet.env
  15. delay: 5
  16. - name: Flannel | Get flannel_subnet from subnet.env
  17. shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_SUBNET" {print $2}'
  18. register: flannel_subnet_output
  19. changed_when: false
  20. - set_fact:
  21. flannel_subnet: "{{ flannel_subnet_output.stdout }}"
  22. - name: Flannel | Get flannel_mtu from subnet.env
  23. shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_MTU" {print $2}'
  24. register: flannel_mtu_output
  25. changed_when: false
  26. - set_fact:
  27. flannel_mtu: "{{ flannel_mtu_output.stdout }}"
  28. - name: Flannel | Set docker daemon options
  29. template:
  30. src: docker
  31. dest: "/etc/default/docker"
  32. owner: root
  33. group: root
  34. mode: 0644
  35. notify:
  36. - restart docker
  37. - name: Flannel | Write docker.service systemd file
  38. template:
  39. src: systemd-docker.service
  40. dest: /lib/systemd/system/docker.service
  41. notify: restart docker
  42. when: ansible_service_mgr == "systemd"
  43. - meta: flush_handlers