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.

59 lines
1.5 KiB

  1. ---
  2. - name: restart etcd
  3. command: /bin/true
  4. notify:
  5. - Backup etcd data
  6. - etcd | reload systemd
  7. - reload etcd
  8. - wait for etcd up
  9. - name: restart etcd-events
  10. command: /bin/true
  11. notify:
  12. - etcd | reload systemd
  13. - reload etcd-events
  14. - wait for etcd-events up
  15. - import_tasks: backup.yml
  16. - name: etcd | reload systemd
  17. systemd:
  18. daemon_reload: true
  19. - name: reload etcd
  20. service:
  21. name: etcd
  22. state: restarted
  23. when: is_etcd_master
  24. - name: reload etcd-events
  25. service:
  26. name: etcd-events
  27. state: restarted
  28. when: is_etcd_master
  29. - name: wait for etcd up
  30. uri:
  31. url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
  32. validate_certs: no
  33. client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
  34. client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
  35. register: result
  36. until: result.status is defined and result.status == 200
  37. retries: 60
  38. delay: 1
  39. - name: wait for etcd-events up
  40. uri:
  41. url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2381/health"
  42. validate_certs: no
  43. client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
  44. client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
  45. register: result
  46. until: result.status is defined and result.status == 200
  47. retries: 60
  48. delay: 1
  49. - name: set etcd_secret_changed
  50. set_fact:
  51. etcd_secret_changed: true