Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pillars and Grains to the rescue
# /srv/pillar/top.sls
base:
'os:Debian':
- match: grain
- debian_packages
'os:RedHat':
- match: grain
- redhat_packages
# /srv/pillar/debian_packages.sls
pkgs:
apache: apache2
# /srv/pillar/redhat_packages.sls
pkgs:
apache: httpd
# /srv/salt/apache.sls
apache:
pkg.installed:
- name: {{ pillar['pkgs']['apache'] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment