kubespray/roles/etcd/handlers/main.yml

65 lines
1.6 KiB
YAML
Raw Normal View History

---
- name: Restart etcd
command: /bin/true
notify:
- Backup etcd data
- Etcd | reload systemd
- Reload etcd
- Wait for etcd up
- Cleanup etcd backups
- name: Restart etcd-events
command: /bin/true
notify:
- Etcd | reload systemd
- Reload etcd-events
- Wait for etcd-events up
- name: Backup etcd
import_tasks: backup.yml
- name: Etcd | reload systemd
systemd:
daemon_reload: true
- name: Reload etcd
service:
name: etcd
state: restarted
when: is_etcd_master
- name: Reload etcd-events
service:
name: etcd-events
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
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
retries: 60
delay: 1
- name: Cleanup etcd backups
import_tasks: backup_cleanup.yml
- name: Wait for etcd-events up
uri:
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2383/health"
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
retries: 60
delay: 1
- name: Set etcd_secret_changed
2016-11-09 18:44:41 +08:00
set_fact:
etcd_secret_changed: true