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.

34 lines
823 B

  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. - import_tasks: backup.yml
  10. - name: etcd | reload systemd
  11. command: systemctl daemon-reload
  12. - name: reload etcd
  13. service:
  14. name: etcd
  15. state: restarted
  16. when: is_etcd_master
  17. - name: wait for etcd up
  18. uri:
  19. url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
  20. validate_certs: no
  21. client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
  22. client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
  23. register: result
  24. until: result.status is defined and result.status == 200
  25. retries: 10
  26. delay: 5
  27. - name: set etcd_secret_changed
  28. set_fact:
  29. etcd_secret_changed: true