upgrade_static.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. # PREREQ Node service is ready to run static pods
  3. # INPUT r_etcd_upgrade_version
  4. - import_tasks: verify_cluster_health.yml
  5. - name: Check for old etcd service files
  6. stat:
  7. path: "{{ item }}"
  8. get_checksum: false
  9. get_attributes: false
  10. get_mime: false
  11. with_items:
  12. - "/etc/systemd/system/etcd.service"
  13. - "/etc/systemd/system/etcd_container.service"
  14. register: old_svc_files
  15. - name: Remove old etcd service files
  16. file:
  17. path: "{{ item.stat.path }}"
  18. state: absent
  19. with_items:
  20. - "{{ old_svc_files.results }}"
  21. when:
  22. - item.stat.exists
  23. - item.stat.isreg
  24. # We removed the ability to detect what was previously 'containerized'
  25. # Need to stop and disable this service, but might not be present.
  26. - name: Stop, disable and mask old etcd service
  27. systemd:
  28. name: "{{ item }}"
  29. state: stopped
  30. enabled: no
  31. masked: yes
  32. daemon_reload: yes
  33. with_items:
  34. - etcd
  35. - etcd_container
  36. failed_when: False
  37. - name: Remove nonexistent services
  38. command: "systemctl reset-failed"
  39. - name: Configure static definition
  40. import_tasks: static.yml
  41. - set_fact:
  42. r_etcd_common_etcd_runtime: static_pod
  43. - import_tasks: verify_cluster_health.yml