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.

34 lines
1.1 KiB

  1. - name: "Pre-upgrade | check for etcd-proxy unit file"
  2. stat:
  3. path: /etc/systemd/system/etcd-proxy.service
  4. register: kube_apiserver_service_file
  5. - name: "Pre-upgrade | check for etcd-proxy init script"
  6. stat:
  7. path: /etc/init.d/etcd-proxy
  8. register: kube_apiserver_init_script
  9. - name: "Pre-upgrade | stop etcd-proxy if service defined"
  10. service:
  11. name: etcd-proxy
  12. state: stopped
  13. when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
  14. - name: "Pre-upgrade | remove etcd-proxy service definition"
  15. file:
  16. path: "{{ item }}"
  17. state: absent
  18. when: (kube_apiserver_service_file.stat.exists|default(False) or kube_apiserver_init_script.stat.exists|default(False))
  19. with_items:
  20. - /etc/systemd/system/etcd-proxy.service
  21. - /etc/init.d/etcd-proxy
  22. - name: "Pre-upgrade | find etcd-proxy container"
  23. command: docker ps -aq --filter "name=etcd-proxy*"
  24. register: etcd_proxy_container
  25. ignore_errors: true
  26. - name: "Pre-upgrade | remove etcd-proxy if it exists"
  27. command: "docker rm -f {{item}}"
  28. with_items: "{{etcd_proxy_container.stdout_lines}}"