Compare commits

...

2 Commits

Author SHA1 Message Date
chris 5b30f273f8 add etcd 2019-12-18 19:36:30 +01:00
chris cb0318742c generate etcd cluster token 2019-12-18 19:34:15 +01:00
5 changed files with 27 additions and 0 deletions

View File

@ -1,2 +1,3 @@
cd group_vars
sed -i "s#^k3s_token.*#k3s_token: $(pwgen 32 1)#" cluster.yaml
sed -i "s#^etcd_cluster_token.*#etcd_cluster_token: $(pwgen 32 1)#" cluster.yaml

View File

@ -1 +1,2 @@
k3s_token: aibahrighaemaeshi2Dahgu9Ahquoo0c
etcd_cluster_token: ed0eephait3Xiew0aebaigh2Ai6Nooch

View File

@ -0,0 +1,6 @@
---
- name: restart etcd
service:
name: etcd
state: restarted
enabled: yes

View 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

View 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