2016-07-08 09:59:21 +00:00
|
|
|
---
|
2019-04-24 07:08:05 +00:00
|
|
|
- name: "Pre-upgrade | Delete master manifests if etcd secrets changed"
|
2017-03-27 11:44:21 +00:00
|
|
|
file:
|
2017-09-15 12:19:37 +00:00
|
|
|
path: "/etc/kubernetes/manifests/{{item}}.manifest"
|
2017-03-27 11:44:21 +00:00
|
|
|
state: absent
|
2017-09-25 11:19:04 +00:00
|
|
|
with_items:
|
2017-03-24 15:29:28 +00:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2016-12-13 09:03:35 +00:00
|
|
|
register: kube_apiserver_manifest_replaced
|
2019-04-24 07:08:05 +00:00
|
|
|
when: etcd_secret_changed|default(false)
|
2016-12-13 09:03:35 +00:00
|
|
|
|
2017-09-15 12:19:37 +00:00
|
|
|
- name: "Pre-upgrade | Delete master containers forcefully"
|
2017-11-08 07:40:33 +00:00
|
|
|
shell: "docker ps -af name=k8s_{{item}}* -q | xargs --no-run-if-empty docker rm -f"
|
2017-09-25 11:19:04 +00:00
|
|
|
with_items:
|
2017-03-27 11:44:21 +00:00
|
|
|
- ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
|
2017-09-09 20:41:20 +00:00
|
|
|
when: kube_apiserver_manifest_replaced.changed
|
2018-03-29 16:37:32 +00:00
|
|
|
register: remove_master_container
|
2019-04-24 07:08:05 +00:00
|
|
|
retries: 10
|
2018-03-29 16:37:32 +00:00
|
|
|
until: remove_master_container.rc == 0
|
2019-04-24 07:08:05 +00:00
|
|
|
delay: 1
|