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.

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