2017-04-03 21:50:17 +08:00
|
|
|
---
|
2017-11-08 15:40:33 +08:00
|
|
|
- name: "Pre-upgrade | check if kubelet container exists"
|
|
|
|
shell: docker ps -af name=kubelet | grep kubelet
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
register: kubelet_container_check
|
|
|
|
|
2017-04-03 21:50:17 +08:00
|
|
|
- name: "Pre-upgrade | copy /var/lib/cni from kubelet"
|
|
|
|
command: docker cp kubelet:/var/lib/cni /var/lib/cni
|
|
|
|
args:
|
|
|
|
creates: "/var/lib/cni"
|
|
|
|
failed_when: false
|
2017-11-08 15:40:33 +08:00
|
|
|
when: kubelet_container_check.rc == 0
|
|
|
|
|
|
|
|
- name: "Pre-upgrade | ensure kubelet container service is stopped if using host deployment"
|
|
|
|
service:
|
|
|
|
name: kubelet
|
|
|
|
state: stopped
|
|
|
|
when: kubelet_deployment_type == 'host' and kubelet_container_check.rc == 0
|
2017-08-21 15:53:49 +08:00
|
|
|
|
2017-11-08 15:40:33 +08:00
|
|
|
- name: "Pre-upgrade | ensure kubelet container is removed if using host deployment"
|
|
|
|
command: docker rm -fv kubelet
|
2017-08-21 15:53:49 +08:00
|
|
|
failed_when: false
|
2017-10-26 04:19:40 +08:00
|
|
|
changed_when: false
|
2017-12-13 02:06:41 +08:00
|
|
|
register: remove_kubelet_container
|
|
|
|
retries: 4
|
|
|
|
until: remove_kubelet_container.rc == 0
|
|
|
|
delay: 5
|
2017-11-08 15:40:33 +08:00
|
|
|
when: kubelet_deployment_type == 'host' and kubelet_container_check.rc == 0
|