6e1c0cdd15
* Add restart for weave service unit * Reuse docker_bin_dir everythere * Limit systemd managed docker containers by CPU/RAM. Do not configure native systemd limits due to the lack of consensus in the kernel community requires out-of-tree kernel patches. Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
---
|
|
- name: Weave | Copy cni plugins from hyperkube
|
|
command: "{{ docker_bin_dir }}/docker run --rm -v /opt/cni/bin:/cnibindir {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }} /bin/cp -r /opt/cni/bin/. /cnibindir/"
|
|
register: cni_task_result
|
|
until: cni_task_result.rc == 0
|
|
retries: 4
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
changed_when: false
|
|
tags: [hyperkube, upgrade]
|
|
|
|
- name: Weave | Install weave
|
|
command: rsync -piu "{{ local_release_dir }}/weave/bin/weave" "{{ bin_dir }}/weave"
|
|
changed_when: false
|
|
|
|
- name: Weave | pull weave images
|
|
shell: "{{ bin_dir }}/weave setup"
|
|
changed_when: false
|
|
|
|
- name: Weave | set perms
|
|
file: path="{{ bin_dir }}/weave" mode=0755 state=file
|
|
|
|
- name: Weave | Set options
|
|
template:
|
|
src: weave.j2
|
|
dest: "/etc/weave.env"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- restart weave
|
|
|
|
- name: Weave | Write weave systemd init file
|
|
template: src=weave.service.j2 dest=/etc/systemd/system/weave.service
|
|
when: ansible_service_mgr == "systemd"
|
|
notify: restart weave
|
|
|
|
- name: Weave | Write weaveproxy systemd init file
|
|
template: src=weaveproxy.service.j2 dest=/etc/systemd/system/weaveproxy.service
|
|
when: ansible_service_mgr == "systemd"
|
|
notify: restart weaveproxy
|
|
|
|
- name: Weave | Write weaveexpose systemd init file
|
|
template: src=weaveexpose.service.j2 dest=/etc/systemd/system/weaveexpose.service
|
|
when: ansible_service_mgr == "systemd"
|
|
notify: restart weaveexpose
|
|
|
|
- meta: flush_handlers
|
|
|
|
- name: Weave | Enable weave
|
|
service: name=weave enabled=yes state=started
|
|
|
|
- name: Weave | Enable weaveproxy
|
|
service: name=weaveproxy enabled=yes state=started
|
|
|
|
- name: Weave | Enable weaveexpose
|
|
service: name=weaveexpose enabled=yes state=started
|