Files
kubespray/roles/etcd/handlers/main.yml
Arthur Outhenin-Chalandre 36e5d742dc Resolve ansible-lint name errors (#10253)
* project: fix ansible-lint name

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: ignore jinja template error in names

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: capitalize ansible name

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: update notify after name capitalization

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

---------

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
2023-07-26 07:36:22 -07:00

65 lines
1.6 KiB
YAML

---
- 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
set_fact:
etcd_secret_changed: true