k8s-sig-cluster-lifecycleawskubesprayhigh-availabilityansiblekubernetes-clustergcekubernetesbare-metal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
884 B
25 lines
884 B
---
|
|
- name: "Pre-upgrade | check for kube-apiserver unit file"
|
|
stat:
|
|
path: /etc/systemd/system/kube-apiserver.service
|
|
register: kube_apiserver_service_file
|
|
|
|
- name: "Pre-upgrade | check for kube-apiserver init script"
|
|
stat:
|
|
path: /etc/init.d/kube-apiserver
|
|
register: kube_apiserver_init_script
|
|
|
|
- name: "Pre-upgrade | stop kube-apiserver if service defined"
|
|
service:
|
|
name: kube-apiserver
|
|
state: stopped
|
|
when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
|
|
|
|
- name: "Pre-upgrade | remove kube-apiserver service definition"
|
|
file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
|
|
with_items:
|
|
- /etc/systemd/system/kube-apiserver.service
|
|
- /etc/init.d/kube-apiserver
|