Skip to content

Instantly share code, notes, and snippets.

@seenae
Last active November 26, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seenae/a12debd5da1546d7e403 to your computer and use it in GitHub Desktop.
Save seenae/a12debd5da1546d7e403 to your computer and use it in GitHub Desktop.
[root@saltm pillar]# salt `hostname` pillar.get my_hosts:profiles
saltm.prod.riva.com:
- app.profiles.abc.prod
- app.profiles.base
- app.profiles.abc.xyz.prod
- app.profiles.abc.redis.prod
[root@saltm pillar]# ll profiles/
total 4
-rw-r--r-- 1 root root 528 Nov 26 07:57 app.profiles.base
-rw-r--r-- 1 root root 0 Nov 26 07:45 app.profiles.abc.xyz.prod
-rw-r--r-- 1 root root 0 Nov 26 07:45 app.profiles.abc.prod
-rw-r--r-- 1 root root 0 Nov 26 07:45 app.profiles.abc.redis.prod
[root@saltm pillar]# cat top.sls
base:
'*':
- aws
{% for profile in salt['pillar.get']('my_hosts:profiles', []) %}
- profiles/{{profile}}
{% endfor %}
[root@saltm pillar]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment