File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : rabbitmq
3+ - hosts : redis
4+
5+ - hosts : vault
6+ roles :
7+ - { role: consul-services }
Original file line number Diff line number Diff line change 11---
22# registry settings
33registry_env : " prod"
4+ registry_port : 80
45
56# for docker stop old container
67stop_time : 5
Original file line number Diff line number Diff line change 1+ ---
2+ - name : make /etc/consul.d folder
3+ sudo : yes
4+ file :
5+ path=/etc/consul.d
6+ state=directory
7+
8+ - name : remove all current configs
9+ sudo : yes
10+ shell : rm -f /etc/consul.d/*.json
11+
12+ - name : put service files in place
13+ sudo : yes
14+ template :
15+ dest=/etc/consul.d/{{ item.name }}.json
16+ src=service.json
17+ with_items :
18+ - name : ' datadog'
19+ host_address : ' {{ datadog_host_address }}'
20+ tags : ['master']
21+ port : ' {{ datadog_port }}'
22+ - name : ' rabbitmq'
23+ host_address : ' {{ rabbit_host_address }}'
24+ tags : ['master']
25+ port : ' {{ rabbit_port }}'
26+ - name : ' redis'
27+ host_address : ' {{ redis_host_address }}'
28+ tags : ['master']
29+ port : ' {{ redis_port }}'
30+ - name : ' registry'
31+ host_address : ' {{ registry_host }}'
32+ tags : ['master']
33+ port : ' {{ registry_port }}'
34+
35+ - name : send consul SIGUP to reload services
36+ sudo : yes
37+ shell : pkill --signal SIGHUP consul
Original file line number Diff line number Diff line change 1+ {
2+ "service" : {
3+ "name" : " {{ item.name }}" ,
4+ "tags" : [ " {{ item.tags | join('" ," ') }}" ],
5+ "address" : " {{ item.host_address }}" ,
6+ "port" : {{ item.port }}
7+ }
8+ }
You can’t perform that action at this time.
0 commit comments