347937ad46
Break up the consul formula into two states: consul and consul-template such that it is possible to install consul without consul-template. Update consul and consul-template to 0.6.4 and 0.14.0 respectively. Consul template can now be configured with pillars.
22 lines
665 B
Text
22 lines
665 B
Text
{% from "consul-template/map.jinja" import consul_template with context %}
|
|
|
|
consul-template-config:
|
|
file.managed:
|
|
- source: salt://consul-template/files/config.json
|
|
- template: jinja
|
|
- name: /etc/consul-template.d/config.json
|
|
|
|
{% if consul_template.tmpl %}
|
|
{% for tmpl in consul_template.tmpl %}
|
|
consul-template-tmpl-file-{{ loop.index }}:
|
|
file.managed:
|
|
- source: {{ tmpl.source }}
|
|
- name: /etc/consul-template/tmpl-source/{{ tmpl.name }}.ctmpl
|
|
|
|
consul-template.d-tmpl-{{ loop.index }}:
|
|
file.serialize:
|
|
- name: /etc/consul-template.d/{{ tmpl.name }}.json
|
|
- dataset: {{ tmpl.config }}
|
|
- formatter: json
|
|
{% endfor %}
|
|
{% endif %}
|