formula-consul/consul/service.sls
George Robinson 347937ad46 Separate consul and consul-template states
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.
2016-04-24 11:20:31 +01:00

27 lines
750 B
Text

{% from "consul/map.jinja" import consul with context %}
consul-init-script:
file.managed:
{% if salt['test.provider']('service') == 'systemd' %}
- source: salt://consul/files/consul.service
- name: /etc/systemd/system/consul.service
- mode: 0644
{% elif salt['test.provider']('service') == 'upstart' %}
- source: salt://consul/files/consul.upstart
- name: /etc/init/consul.conf
- mode: 0644
{% else %}
- source: salt://consul/files/consul.sysvinit
- name: /etc/init.d/consul
- mode: 0755
{% endif %}
{% if consul.service != False %}
- watch_in:
- service: consul
{% endif %}
{% if consul.service != False %}
consul-service:
service.running:
- name: consul
{% endif %}