2016-01-19 22:23:19 +08:00
|
|
|
---
|
2016-01-25 09:01:25 +08:00
|
|
|
- name: restart etcd
|
2016-01-19 22:23:19 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2017-03-17 03:38:13 +08:00
|
|
|
- Backup etcd data
|
2016-07-29 17:46:24 +08:00
|
|
|
- etcd | reload systemd
|
2016-01-25 09:01:25 +08:00
|
|
|
- reload etcd
|
2016-07-19 21:45:37 +08:00
|
|
|
- wait for etcd up
|
2016-01-19 22:23:19 +08:00
|
|
|
|
2018-01-29 19:37:48 +08:00
|
|
|
- import_tasks: backup.yml
|
2017-03-17 03:38:13 +08:00
|
|
|
|
2016-07-29 17:46:24 +08:00
|
|
|
- name: etcd | reload systemd
|
2016-01-19 22:23:19 +08:00
|
|
|
command: systemctl daemon-reload
|
|
|
|
|
2016-11-19 06:08:19 +08:00
|
|
|
- name: reload etcd
|
|
|
|
service:
|
|
|
|
name: etcd
|
|
|
|
state: restarted
|
|
|
|
when: is_etcd_master
|
|
|
|
|
2016-07-19 21:45:37 +08:00
|
|
|
- name: wait for etcd up
|
2017-02-18 05:22:34 +08:00
|
|
|
uri:
|
|
|
|
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
|
|
|
|
validate_certs: no
|
2017-11-07 22:06:16 +08:00
|
|
|
client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
|
|
|
|
client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
|
2016-07-19 21:45:37 +08:00
|
|
|
register: result
|
2016-11-09 18:31:12 +08:00
|
|
|
until: result.status is defined and result.status == 200
|
2016-07-19 21:45:37 +08:00
|
|
|
retries: 10
|
|
|
|
delay: 5
|
2016-06-24 20:25:16 +08:00
|
|
|
|
2016-11-09 18:44:41 +08:00
|
|
|
- name: set etcd_secret_changed
|
|
|
|
set_fact:
|
|
|
|
etcd_secret_changed: true
|