blob: 656901409051f563947cc33affcaeadb60ab8ba7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
---
- name: Install etcd
yum: pkg=etcd-2.* state=present
- name: Validate permissions on the config dir
file:
path: "{{ etcd_conf_dir }}"
state: directory
owner: etcd
group: etcd
mode: 0700
- name: Validate permissions on certificate files
file:
path: "{{ item }}"
mode: 0600
group: etcd
owner: etcd
when: etcd_url_scheme == 'https'
with_items:
- "{{ etcd_ca_file }}"
- "{{ etcd_cert_file }}"
- "{{ etcd_key_file }}"
- name: Validate permissions on peer certificate files
file:
path: "{{ item }}"
mode: 0600
group: etcd
owner: etcd
when: etcd_peer_url_scheme == 'https'
with_items:
- "{{ etcd_peer_ca_file }}"
- "{{ etcd_peer_cert_file }}"
- "{{ etcd_peer_key_file }}"
- name: Write etcd global config file
template:
src: etcd.conf.j2
dest: /etc/etcd/etcd.conf
backup: true
notify:
- restart etcd
- name: Enable etcd
service:
name: etcd
state: started
enabled: yes
register: start_result
- pause: seconds=30
when: start_result | changed
|