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.

29 lines
887 B

  1. ---
  2. - name: "Pre-upgrade | check if kubelet container exists"
  3. shell: docker ps -af name=kubelet | grep kubelet
  4. failed_when: false
  5. changed_when: false
  6. register: kubelet_container_check
  7. - name: "Pre-upgrade | copy /var/lib/cni from kubelet"
  8. command: docker cp kubelet:/var/lib/cni /var/lib/cni
  9. args:
  10. creates: "/var/lib/cni"
  11. failed_when: false
  12. when: kubelet_container_check.rc == 0
  13. - name: "Pre-upgrade | ensure kubelet container service is stopped if using host deployment"
  14. service:
  15. name: kubelet
  16. state: stopped
  17. when: kubelet_container_check.rc == 0
  18. - name: "Pre-upgrade | ensure kubelet container is removed if using host deployment"
  19. command: docker rm -fv kubelet
  20. failed_when: false
  21. changed_when: false
  22. register: remove_kubelet_container
  23. retries: 4
  24. until: remove_kubelet_container.rc == 0
  25. delay: 5
  26. when: kubelet_container_check.rc == 0