c12s-kubespray/roles/network_plugin/weave/tasks/pre-upgrade.yml
Matthew Mosesohn 29fd957352 Enable weave upgrade from previous versions
Raise readiness probe initial time to 60 (was 30)
2017-02-09 21:39:31 +03:00

39 lines
1.1 KiB
YAML

- name: Weave pre-upgrade | Stop legacy weave
command: weave stop
failed_when: false
- name: Weave pre-upgrade | Stop legacy systemd weave services
service:
name: "{{ item }}"
enabled: no
state: stopped
with_items:
- weaveexpose
- weaveproxy
- weave
failed_when: false
- name: Weave pre-upgrade | Purge legacy systemd weave systemd unit files
file:
path: "{{ item }}"
state: absent
register: purged_weave_systemd_units
with_items:
- "/etc/systemd/system/weaveexpose.service"
- "/etc/systemd/system/weaveproxy.service"
- "/etc/systemd/system/weave.service"
- name: Weave pre-upgrade | Reload systemd
command: systemctl daemon-reload
when: ansible_service_mgr == "systemd" and purged_weave_systemd_units.changed
- name: Weave pre-upgrade | Purge legacy weave configs and binary
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ bin_dir }}/weave"
- "/etc/weave.env"
- name: Weave pre-upgrade | Purge legacy weave docker containers
shell: "docker ps -af 'name=^/weave.*' -q | xargs --no-run-if-empty docker rm -f"