add etcd
This commit is contained in:
parent
cb0318742c
commit
5b30f273f8
3 changed files with 25 additions and 0 deletions
6
roles/etcd/handlers/main.yaml
Normal file
6
roles/etcd/handlers/main.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: restart etcd
|
||||
service:
|
||||
name: etcd
|
||||
state: restarted
|
||||
enabled: yes
|
9
roles/etcd/tasks/main.yaml
Normal file
9
roles/etcd/tasks/main.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: etcd-server package
|
||||
apt:
|
||||
name: etcd-server
|
||||
- name: etcd configuration
|
||||
template:
|
||||
src: defaults-etcd.j2
|
||||
dest: /etc/defaults/etcd
|
||||
notify: restart etcd
|
10
roles/etcd/templates/defaults-etcd.j2
Normal file
10
roles/etcd/templates/defaults-etcd.j2
Normal file
|
@ -0,0 +1,10 @@
|
|||
ETCD_NAME="{{ansible_nodename}}"
|
||||
ETCD_DATA_DIR="/var/lib/etcd"
|
||||
ETCD_LISTEN_PEER_URLS="http://{{wg_ip}}:2380"
|
||||
ETCD_LISTEN_CLIENT_URLS="http://{{wg_ip}}:2379"
|
||||
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://{{ansible_nodename}}:2380"
|
||||
ETCD_INITIAL_CLUSTER="node01=http://10.23.23.11:2380,node02=http://10.23.23.12:22380,node03=http://10.23.23.13:32380"
|
||||
ETCD_INITIAL_CLUSTER_STATE="new"
|
||||
ETCD_INITIAL_CLUSTER_TOKEN="{{etcd_cluster_token}}"
|
||||
ETCD_ADVERTISE_CLIENT_URLS="http://{{ansible_nodename}}:2379"
|
||||
ETCD_AUTO_COMPACTION_RETENTION=3
|
Loading…
Reference in a new issue