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.

61 lines
1.6 KiB

9 years ago
  1. ---
  2. - name: Flannel | delete default docker bridge
  3. command: ip link delete docker0
  4. failed_when: false
  5. notify: Flannel | restart docker
  6. - name: Flannel | delete flannel interface
  7. command: ip link delete flannel.1
  8. failed_when: false
  9. # special cases for atomic because it defaults to live-restore: true
  10. # So we disable live-restore to pickup the new flannel IP. After
  11. # we enable it, we have to restart docker again to pickup the new
  12. # setting and restore the original behavior
  13. - name: Flannel | restart docker
  14. command: /bin/true
  15. notify:
  16. - Flannel | reload systemd
  17. - Flannel | reload docker.socket
  18. - Flannel | configure docker live-restore true (atomic)
  19. - Flannel | reload docker
  20. - Flannel | pause while Docker restarts
  21. - Flannel | wait for docker
  22. - name: Flannel | reload systemd
  23. shell: systemctl daemon-reload
  24. - name: Flannel | reload docker.socket
  25. service:
  26. name: docker.socket
  27. state: restarted
  28. when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
  29. - name: Flannel | configure docker live-restore true (atomic)
  30. replace:
  31. name: /etc/docker/daemon.json
  32. regexp: '"live-restore":.*true'
  33. replace: '"live-restore": false'
  34. when: is_atomic
  35. - name: Flannel | reload docker
  36. service:
  37. name: docker
  38. state: restarted
  39. - name: Flannel | pause while Docker restarts
  40. pause:
  41. seconds: 10
  42. prompt: "Waiting for docker restart"
  43. - name: Flannel | wait for docker
  44. command: "{{ docker_bin_dir }}/docker images"
  45. register: docker_ready
  46. retries: 10
  47. delay: 5
  48. until: docker_ready.rc == 0
  49. - name: Flannel | reload kubelet
  50. service:
  51. name: kubelet
  52. state: restarted