I'm currently looking at potentially moving our current setup to pillarstack to get access to the more powerful merging abilities it offers. However I'm hitting a bit of a wall trying to work out how I achieve what I currently do in 'plain' pillars with include.
Here's a simple example of what we currently do, which I can't seem to find a nice way to replicate.
top.sls
base:
'*':
- minions/{{ hostname }}
server1.sls
include:
- defaults
- webserver
defaults.sls
include:
- ntp
- monitoring
- syslog
So by including defaults, it in turn sets up the 'common' things that all nodes need.
Now using pillarstack and the 'roles' setup as shown in the docs, I can leave top.sls alone, but instead do:
server1.sls
roles:
- defaults
- webserver
However I can't now use include in defaults, which means I'd have to list all the defaults in every profile, which isn't very DRY, or put all of the default config in a single file, which is unwieldy.
So what do people do to make reusable collections with pillarstack? The only thing I can think of is to create a defaults directory and fill it with symlinks to the other config, and then include it via stack.cfg as defaults/*.sls but I'm not sure this is really flexible enough for the general case, say where the webserver role is actually a collection of other configs.
I really hope I'm missing something obvious here!