-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplaybook.yml
43 lines (36 loc) · 919 Bytes
/
playbook.yml
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
- name: Configure Consul
hosts: all
connection: ssh
gather_facts: yes
become: yes
become_user: root
become_method: sudo
tasks:
- name: Get Vars
include_vars:
file: ansiblevars.yml
- name: Get Consul Binary
get_url:
url: "{{ build.consul_url }}{{ build.consul_binary }}"
dest: /tmp/{{ build.consul_binary }}
- name: Unzip Consul Binary
unarchive:
src: /tmp/{{ build.consul_binary }}
dest: /usr/local/bin/
remote_src: yes
- name: Copy Consul Service File
template:
dest: /etc/systemd/system/consul.service
src: consul.service
- name: Enable Consul Service
systemd:
name: consul
enabled: yes
- name: Create Consul Configuration File
template:
src: consul.config.json
dest: /etc/consul.d/server/
- name: Create Consul Data Directory
file:
path: /var/consul
state: directory