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.

53 lines
1.3 KiB

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. timeout: 600
  17. - name: Flannel | Get flannel_subnet from subnet.env
  18. shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_SUBNET" {print $2}'
  19. register: flannel_subnet_output
  20. changed_when: false
  21. - set_fact:
  22. flannel_subnet: "{{ flannel_subnet_output.stdout }}"
  23. - name: Flannel | Get flannel_mtu from subnet.env
  24. shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_MTU" {print $2}'
  25. register: flannel_mtu_output
  26. changed_when: false
  27. - set_fact:
  28. flannel_mtu: "{{ flannel_mtu_output.stdout }}"
  29. - name: Flannel | Set docker daemon options
  30. template:
  31. src: docker
  32. dest: "/etc/default/docker"
  33. owner: root
  34. group: root
  35. mode: 0644
  36. notify:
  37. - restart docker
  38. - name: Flannel | Create docker config symlink for CoreOS
  39. file:
  40. src: "/etc/default/docker"
  41. dest: "/run/flannel_docker_opts.env"
  42. state: link
  43. when: ansible_os_family == "CoreOS"
  44. - meta: flush_handlers