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:
|
2019-05-02 21:24:21 +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
|
|
|
|
2020-08-05 14:56:28 +00:00
|
|
|
- name: "Pre-upgrade | Delete master containers forcefully" # noqa 503
|
|
|
|
shell: "set -o pipefail && docker ps -af name=k8s_{{ item }}* -q | xargs --no-run-if-empty docker rm -f"
|
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
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
|