2016-01-19 22:23:19 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +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
|
2023-07-26 22:36:22 +08:00
|
|
|
- Etcd | reload systemd
|
|
|
|
- Reload etcd
|
|
|
|
- Wait for etcd up
|
2022-08-05 23:09:59 +08:00
|
|
|
- Cleanup etcd backups
|
2016-01-19 22:23:19 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Restart etcd-events
|
2018-03-01 16:39:14 +08:00
|
|
|
command: /bin/true
|
|
|
|
notify:
|
2023-07-26 22:36:22 +08:00
|
|
|
- Etcd | reload systemd
|
|
|
|
- Reload etcd-events
|
|
|
|
- Wait for etcd-events up
|
2018-03-01 16:39:14 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Backup etcd
|
|
|
|
import_tasks: backup.yml
|
2017-03-17 03:38:13 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Etcd | reload systemd
|
2019-04-24 13:18:00 +08:00
|
|
|
systemd:
|
|
|
|
daemon_reload: true
|
2016-01-19 22:23:19 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Reload etcd
|
2016-11-19 06:08:19 +08:00
|
|
|
service:
|
|
|
|
name: etcd
|
|
|
|
state: restarted
|
|
|
|
when: is_etcd_master
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Reload etcd-events
|
2018-03-01 16:39:14 +08:00
|
|
|
service:
|
|
|
|
name: etcd-events
|
|
|
|
state: restarted
|
|
|
|
when: is_etcd_master
|
|
|
|
|
2023-07-26 22:36:22 +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
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 60
|
|
|
|
delay: 1
|
2016-06-24 20:25:16 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Cleanup etcd backups
|
|
|
|
import_tasks: backup_cleanup.yml
|
2022-08-05 23:09:59 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Wait for etcd-events up
|
2018-03-01 16:39:14 +08:00
|
|
|
uri:
|
2021-12-07 16:28:01 +08:00
|
|
|
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2383/health"
|
2018-03-01 16:39:14 +08:00
|
|
|
validate_certs: no
|
|
|
|
client_cert: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem"
|
|
|
|
client_key: "{{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem"
|
|
|
|
register: result
|
|
|
|
until: result.status is defined and result.status == 200
|
2019-04-24 15:08:05 +08:00
|
|
|
retries: 60
|
|
|
|
delay: 1
|
2018-03-01 16:39:14 +08:00
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Set etcd_secret_changed
|
2016-11-09 18:44:41 +08:00
|
|
|
set_fact:
|
|
|
|
etcd_secret_changed: true
|