upgrade_static.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # PREREQ Node service is ready to run static pods
  3. # INPUT r_etcd_upgrade_version
  4. - name: Verify cluster is healthy pre-upgrade
  5. command: "{{ etcdctlv2 }} cluster-health"
  6. # We removed the ability to detect what was previously 'containerized'
  7. # Need to stop and disable this service, but might not be present.
  8. - name: Stop, disable and mask old etcd service
  9. systemd:
  10. name: "{{ item }}"
  11. state: stopped
  12. enabled: no
  13. masked: yes
  14. daemon_reload: yes
  15. with_items:
  16. - etcd
  17. - etcd_container
  18. failed_when: False
  19. - name: Remove old etcd service files
  20. file:
  21. path: "{{ item }}"
  22. state: absent
  23. with_items:
  24. - "/etc/systemd/system/etcd.service"
  25. - "/etc/systemd/system/etcd_container.service"
  26. - name: Remove nonexistent services
  27. command: "systemctl reset-failed"
  28. - name: Configure static definition
  29. import_tasks: static.yml
  30. - set_fact:
  31. r_etcd_common_etcd_runtime: static_pod
  32. - name: Verify cluster is healthy
  33. command: "{{ etcdctlv2 }} cluster-health"
  34. register: etcdctl
  35. until: etcdctl.rc == 0 and 'stopped' not in etcdctl.stderr
  36. retries: 30
  37. delay: 10