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

  1. ---
  2. - name: "Pre-upgrade | check for kube-apiserver unit file"
  3. stat:
  4. path: /etc/systemd/system/kube-apiserver.service
  5. register: kube_apiserver_service_file
  6. - name: "Pre-upgrade | check for kube-apiserver init script"
  7. stat:
  8. path: /etc/init.d/kube-apiserver
  9. register: kube_apiserver_init_script
  10. - name: "Pre-upgrade | stop kube-apiserver if service defined"
  11. service:
  12. name: kube-apiserver
  13. state: stopped
  14. when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
  15. - name: "Pre-upgrade | remove kube-apiserver service definition"
  16. file:
  17. path: "{{ item }}"
  18. state: absent
  19. when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
  20. with_items:
  21. - /etc/systemd/system/kube-apiserver.service
  22. - /etc/init.d/kube-apiserver