paulbsd-salt/states/services/init.sls
2020-07-10 00:58:55 +02:00

23 lines
524 B
Plaintext

---
include:
- pkg
{%- if salt['pillar.get']('services:enable') != None -%}
{%- for service in salt['pillar.get']('services:enable') %}
service-{{ service }}:
service.running:
- name: {{ service }}
- enable: True
- require:
- pkg: pkg-install
{%- endfor %}
{%- endif %}
{%- if salt['pillar.get']('services:disable') != None -%}
{%- for service in salt['pillar.get']('services:disable') %}
service-{{ service }}:
service.dead:
- name: {{ service }}
- enable: False
{%- endfor %}
{%- endif %}