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.

21 lines
781 B

  1. ---
  2. - name: "Pre-upgrade | Delete master manifests if etcd secrets changed"
  3. file:
  4. path: "/etc/kubernetes/manifests/{{ item }}.manifest"
  5. state: absent
  6. with_items:
  7. - ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
  8. register: kube_apiserver_manifest_replaced
  9. when: etcd_secret_changed|default(false)
  10. - name: "Pre-upgrade | Delete master containers forcefully" # noqa 503
  11. shell: "set -o pipefail && docker ps -af name=k8s_{{ item }}* -q | xargs --no-run-if-empty docker rm -f"
  12. args:
  13. executable: /bin/bash
  14. with_items:
  15. - ["kube-apiserver", "kube-controller-manager", "kube-scheduler"]
  16. when: kube_apiserver_manifest_replaced.changed
  17. register: remove_master_container
  18. retries: 10
  19. until: remove_master_container.rc == 0
  20. delay: 1