2016-04-22 06:40:14 -04:00
|
|
|
{% from "consul/map.jinja" import consul, consul_template with context %}
|
2015-10-22 15:29:19 -04:00
|
|
|
|
|
|
|
consul-config:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://consul/files/config.json
|
|
|
|
- template: jinja
|
|
|
|
- name: /etc/consul.d/config.json
|
|
|
|
{% if consul.service != False %}
|
|
|
|
- watch_in:
|
|
|
|
- service: consul
|
|
|
|
{% endif %}
|
|
|
|
- user: consul
|
|
|
|
- group: consul
|
|
|
|
- require:
|
|
|
|
- user: consul
|
|
|
|
|
|
|
|
{% for script in consul.scripts %}
|
|
|
|
consul-script-install-{{ loop.index }}:
|
|
|
|
file.managed:
|
|
|
|
- source: {{ script.source }}
|
|
|
|
- name: {{ script.name }}
|
|
|
|
- template: jinja
|
|
|
|
- user: consul
|
|
|
|
- group: consul
|
|
|
|
- mode: 0755
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
consul-script-config:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://consul/files/services.json
|
|
|
|
- name: /etc/consul.d/services.json
|
|
|
|
- template: jinja
|
|
|
|
{% if consul.service != False %}
|
|
|
|
- watch_in:
|
|
|
|
- service: consul
|
|
|
|
{% endif %}
|
|
|
|
- user: consul
|
|
|
|
- group: consul
|
|
|
|
- require:
|
|
|
|
- user: consul
|
2016-04-22 06:40:14 -04:00
|
|
|
|
|
|
|
consul-template-config:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://consul/files/consul-template-config.json
|
|
|
|
- template: jinja
|
|
|
|
- name: /etc/consul-template.d/config.json
|