2016-04-22 08:35:04 -04:00
|
|
|
{% from "consul-template/map.jinja" import consul_template with context %}
|
|
|
|
|
|
|
|
consul-template-init-script:
|
|
|
|
file.managed:
|
|
|
|
{% if salt['test.provider']('service') == 'systemd' %}
|
|
|
|
- source: salt://consul-template/files/consul-template.service
|
|
|
|
- name: /etc/systemd/system/consul-template.service
|
|
|
|
- mode: 0644
|
2016-09-02 04:26:58 -04:00
|
|
|
{% elif salt['test.provider']('service') == 'upstart' %}
|
|
|
|
- source: salt://consul-template/files/consul-template-upstart.service
|
|
|
|
- name: /etc/init/consul-template.conf
|
|
|
|
- mode: 0644
|
2016-04-22 08:35:04 -04:00
|
|
|
{% endif %}
|
|
|
|
{% if consul_template.service != False %}
|
|
|
|
- watch_in:
|
|
|
|
- service: consul
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if consul_template.service != False %}
|
|
|
|
consul-template-service:
|
|
|
|
service.running:
|
|
|
|
- name: consul-template
|
|
|
|
- watch:
|
|
|
|
- file: /etc/consul-template.d/*
|
|
|
|
{% endif %}
|