2015-10-07 14:18:22 -04:00
|
|
|
consul:
|
2016-10-24 06:43:23 -04:00
|
|
|
# Start Consul agent service and enable it at boot time
|
|
|
|
service: True
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2017-11-28 05:16:19 -05:00
|
|
|
# Set user and group for Consul config files and running service
|
|
|
|
user: consul
|
|
|
|
group: consul
|
|
|
|
|
2015-10-07 15:02:53 -04:00
|
|
|
config:
|
2016-10-24 06:43:23 -04:00
|
|
|
server: True
|
2015-10-07 15:02:53 -04:00
|
|
|
bind_addr: 0.0.0.0
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2016-10-24 06:43:23 -04:00
|
|
|
enable_debug: True
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2015-10-08 07:49:10 -04:00
|
|
|
datacenter: eu
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2015-10-08 08:26:43 -04:00
|
|
|
encrypt: "RIxqpNlOXqtr/j4BgvIMEw=="
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2015-10-08 08:26:43 -04:00
|
|
|
bootstrap_expect: 3
|
|
|
|
retry_interval: 15s
|
|
|
|
retry_join:
|
|
|
|
- 1.1.1.1
|
|
|
|
- 2.2.2.2
|
2015-10-22 15:29:19 -04:00
|
|
|
|
2015-10-09 17:39:53 -04:00
|
|
|
register:
|
|
|
|
- name: Redis
|
|
|
|
checks:
|
2015-10-22 14:04:02 -04:00
|
|
|
- script: /usr/local/share/consul/check_redis.py
|
2015-10-09 17:39:53 -04:00
|
|
|
interval: 10s
|
2015-10-09 18:13:15 -04:00
|
|
|
scripts:
|
2016-10-24 06:43:23 -04:00
|
|
|
- source: salt://files/consul/check_redis.py
|
2015-10-22 14:04:02 -04:00
|
|
|
name: /usr/local/share/consul/check_redis.py
|
2017-09-11 07:16:51 -04:00
|
|
|
context:
|
|
|
|
port: 6379
|
2016-04-22 17:33:38 -04:00
|
|
|
|
|
|
|
consul_template:
|
2016-10-24 06:43:23 -04:00
|
|
|
# Start consul-template daemon and enable it at boot time
|
|
|
|
service: True
|
|
|
|
|
2016-04-22 17:33:38 -04:00
|
|
|
config:
|
|
|
|
consul: 127.0.0.1:8500
|
|
|
|
log_level: info
|
2016-10-24 06:43:23 -04:00
|
|
|
|
2016-04-22 17:33:38 -04:00
|
|
|
tmpl:
|
|
|
|
- name: example.com
|
|
|
|
source: salt://files/example.com.ctmpl
|
|
|
|
config:
|
|
|
|
template:
|
|
|
|
source: /etc/consul-template/tmpl-source/example.com.ctmpl
|
|
|
|
destination: /etc/nginx/sites-enabled/example.com
|
|
|
|
command: systemctl restart nginx
|
2016-10-24 06:43:23 -04:00
|
|
|
|
|
|
|
# vim: ft=yaml
|