--- 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 %}