c04a6254b9
etcd is crucial part of kubernetes cluster. Ansible restarts etcd on reconfiguration. Backup helps operator to restore cluster manually in case of any issues. Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
33 lines
666 B
YAML
33 lines
666 B
YAML
---
|
|
- name: restart etcd
|
|
command: /bin/true
|
|
notify:
|
|
- Backup etcd data
|
|
- etcd | reload systemd
|
|
- reload etcd
|
|
- wait for etcd up
|
|
|
|
- include: backup.yml
|
|
|
|
- name: etcd | reload systemd
|
|
command: systemctl daemon-reload
|
|
|
|
- name: reload etcd
|
|
service:
|
|
name: etcd
|
|
state: restarted
|
|
when: is_etcd_master
|
|
|
|
- name: wait for etcd up
|
|
uri:
|
|
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
|
|
validate_certs: no
|
|
register: result
|
|
until: result.status is defined and result.status == 200
|
|
retries: 10
|
|
delay: 5
|
|
|
|
- name: set etcd_secret_changed
|
|
set_fact:
|
|
etcd_secret_changed: true
|
|
|