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.

55 lines
1.7 KiB

  1. ---
  2. - name: Weave | Copy cni plugins from hyperkube
  3. command: "/usr/bin/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
  4. register: cni_task_result
  5. until: cni_task_result.rc == 0
  6. retries: 4
  7. delay: "{{ retry_stagger | random + 3 }}"
  8. changed_when: false
  9. - name: Weave | Install weave
  10. command: rsync -piu "{{ local_release_dir }}/weave/bin/weave" "{{ bin_dir }}/weave"
  11. changed_when: false
  12. - name: Weave | pull weave images
  13. shell: "{{ bin_dir }}/weave setup"
  14. changed_when: false
  15. - name: Weave | set perms
  16. file: path="{{ bin_dir }}/weave" mode=0755 state=file
  17. - name: Weave | Set options
  18. template:
  19. src: weave.j2
  20. dest: "/etc/weave.env"
  21. owner: root
  22. group: root
  23. mode: 0644
  24. notify:
  25. - restart weave
  26. - name: Weave | Write weave systemd init file
  27. template: src=weave.service.j2 dest=/etc/systemd/system/weave.service
  28. when: ansible_service_mgr == "systemd"
  29. notify: restart weave
  30. - name: Weave | Write weaveproxy systemd init file
  31. template: src=weaveproxy.service.j2 dest=/etc/systemd/system/weaveproxy.service
  32. when: ansible_service_mgr == "systemd"
  33. notify: restart weaveproxy
  34. - name: Weave | Write weaveexpose systemd init file
  35. template: src=weaveexpose.service.j2 dest=/etc/systemd/system/weaveexpose.service
  36. when: ansible_service_mgr == "systemd"
  37. notify: restart weaveexpose
  38. - meta: flush_handlers
  39. - name: Weave | Enable weave
  40. service: name=weave enabled=yes state=started
  41. - name: Weave | Enable weaveproxy
  42. service: name=weaveproxy enabled=yes state=started
  43. - name: Weave | Enable weaveexpose
  44. service: name=weaveexpose enabled=yes state=started