Skip to content

Commit ad6ab32

Browse files
consul adding
1 parent 9c9d9e5 commit ad6ab32

4 files changed

Lines changed: 42 additions & 0 deletions

File tree

ansible/beta-hosts/hosts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ api
2020
[api]
2121
beta-api
2222

23+
[consul-server]
24+
beta-services
25+
beta-api
26+
beta-web
27+
2328
[worker]
2429
beta-api
2530

ansible/consul-agent.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- hosts: consul-server
3+
vars_files:
4+
- "group_vars/alpha-consul-server.yml"
5+
roles:
6+
- { role: notify, tags: "notify" }
7+
- { role: container_kill_start, tags: "deploy" }

ansible/consul-server.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- hosts: consul-server
3+
vars_files:
4+
- "group_vars/alpha-consul-server.yml"
5+
roles:
6+
- { role: notify, tags: "notify" }
7+
- { role: container_kill_start, tags: "deploy" }
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "consul-server"
2+
3+
container_image: "progrium/consul"
4+
container_tag: "master"
5+
6+
container_run_opts: >
7+
-d
8+
-h $HOSTNAME
9+
-v /consul:/data
10+
-p 8300:8300
11+
-p 8301:8301
12+
-p 8301:8301/udp
13+
-p 8302:8302
14+
-p 8302:8302/udp
15+
-p 8400:8400
16+
-p 8500:8500
17+
--restart=always
18+
19+
container_run_args: >
20+
-server
21+
-advertise {{ ansible_default_ipv4.address }}
22+
-bootstrap-expect {{ groups['palantiri'] | length }}
23+
{% if hostvars[groups['palantiri'][0]]['ansible_default_ipv4']['address'] != ansible_default_ipv4.address %}-retry-join {{ hostvars[groups['palantiri'][0]]['ansible_default_ipv4']['address'] }}{% endif %}

0 commit comments

Comments
 (0)