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.

58 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. command: systemctl daemon-reload
  18. - name: reload etcd
  19. service:
  20. name: etcd
  21. state: restarted
  22. when: is_etcd_master
  23. - name: reload etcd-events
  24. service:
  25. name: etcd-events
  26. state: restarted
  27. when: is_etcd_master
  28. - name: wait for etcd up
  29. uri:
  30. url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
  31. validate_certs: no
  32. client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
  33. client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
  34. register: result
  35. until: result.status is defined and result.status == 200
  36. retries: 10
  37. delay: 5
  38. - name: wait for etcd-events up
  39. uri:
  40. url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2381/health"
  41. validate_certs: no
  42. client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
  43. client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
  44. register: result
  45. until: result.status is defined and result.status == 200
  46. retries: 10
  47. delay: 5
  48. - name: set etcd_secret_changed
  49. set_fact:
  50. etcd_secret_changed: true