2021-01-19 17:41:00 +08:00
|
|
|
# to clean 'kube_master' nodes
|
|
|
|
- name: stop and disable kube_master service
|
2019-06-02 00:04:33 +08:00
|
|
|
service: name={{ item }} state=stopped enabled=no
|
|
|
|
with_items:
|
|
|
|
- kube-apiserver
|
|
|
|
- kube-controller-manager
|
|
|
|
- kube-scheduler
|
|
|
|
ignore_errors: true
|
2021-01-19 17:41:00 +08:00
|
|
|
when: "inventory_hostname in groups['kube_master']"
|
2019-06-02 00:04:33 +08:00
|
|
|
|
2021-01-19 17:41:00 +08:00
|
|
|
- name: remove files and dirs of 'kube_master' nodes
|
2019-06-02 00:04:33 +08:00
|
|
|
file: name={{ item }} state=absent
|
|
|
|
with_items:
|
|
|
|
- "/var/run/kubernetes"
|
|
|
|
- "/etc/systemd/system/kube-apiserver.service"
|
|
|
|
- "/etc/systemd/system/kube-controller-manager.service"
|
|
|
|
- "/etc/systemd/system/kube-scheduler.service"
|
2022-10-31 20:15:44 +08:00
|
|
|
ignore_errors: true
|
2021-01-19 17:41:00 +08:00
|
|
|
when: "inventory_hostname in groups['kube_master']"
|