-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an include mecanism #45
Comments
Not sure it answers your question, but we use Jinja to do includes like this
|
With
To have include really work, it would need to dynamicly add files like to be included like they would have been present in the top-level file. As stack is already having special-key named An alternative I'm thinking about right now, would be that if top-level is a list (and not a dict), have it merge each element one after an other. That would also allow to add elements, while deleting a top-level key from a single file (currently, I have to do it with different files) -- but probably too complicated, and that could lead to too many errors. |
I'd like to add my support to this request. We have lots of places where we use
The only way I've found of replicating this in pillarstack is by using symlinks and globs, i.e.:
Which is a bit of a hacky way of doing it. |
You can give salt-tower a try. It works similar to pillarstack and supports an Disclaimer: I'm the author. Feel free to ask for guidance or take a look at the examples. |
I do usually do the opposite, see following example. stack.cfg
minions/myminion.yml
roles/apache.yml
and so on... It is possible to have more complex infers like: stack.cfg
minions/myminion.yml
roles/infer.yml
roles/apache.yml
Given such flexibility I don't know if an include statement is required at all. |
It would be nice if pillarstack had a similar include mecanism that base pillars have.
Our use case is that we have role based pillar that "infer" another role. (For example nginx role and apache role both should include "certificates" role) In a traditional pillar setting we would just have an include in both included roles. With pillarstack we are having trouble finding and elegant way of doing this (import_as_yaml is not very nice, and loops and ifs in the config.cfg aren't much nicer).
The text was updated successfully, but these errors were encountered: