etcd role for controller nodes

This commit is contained in:
2023-01-03 00:32:26 +01:00
parent e4d93900c4
commit 8c80487481
7 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
---
- name: Add etcd systemd unit
template:
src: etcd.service.j2
dest: /etc/systemd/system/etcd.service
mode: 700
become: true
- name: Reload systemd
command: systemctl daemon-reload
become: true
- name: Enable etcd service
command: systemctl enable etcd
become: true
- name: Restart etcd
service:
name: etcd
state: restarted
enabled: yes
become: true
- name: Wait for etcd listening
wait_for: port=2379 timeout=60
# - name: Verify etcd cluster health
# shell: etcdctl --ca-file=/etc/etcd/ca.pem cluster-health
# register: cmd_result
# until: cmd_result.stdout.find("cluster is healthy") != -1
# retries: 5
# delay: 5