You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: extend functionality in pillar .sls #3991
Corerelates to code central or existential to SaltFeaturenew functionality including changes to functionality and code refactors, etc.P1Priority 1Pillarstale
This can get very complicated because pillar data is not structured like state data, but it should be a viable thing to add, I have set this to 0.15.0, but it might get bumped if it proves too complicated
Default should be simple, and the current behavior -- overwrite -- is fine for the default. At least you can control it with the order of include's. Union will change arity of the data, which becomes problematic for nested structures.
Let's define a uniform convention and have tests which will demonstrate each case. Then the tests can serve as the docs on include/extend behaviors.
ran into this today, wanted to extend a network setting pillar with another one derived from the first and was puzzled why the data was missing.
+1 from me!
+1 Please make some way of mixing data structures. Otherwise it is impossible to manage complicated structures such as access lists without lots of CUT & PASTE.
Another +1 here. I tend to use the top level pillar object name for scoping the pillar data and would like to be able to extend the object with more data from another pillar file.
+1 forced to use unique id's is giving me a long complicated pillar dict for a server. and the state configuration now needs to look for different keys, where it could just loop through one if pillar dicts were extensible.
Thanks @genuss. reading through the page it looks like it would do what i want.. although one thing I'm unsure about is the following line in the PillarStack Configuration Files section
"The path of these yaml files must be relative to the directory of the PillarStack config file."
This would imply that it only works if the pillar yaml files are locally on the salt master with the pillarstack config file?
I'm using the gitfs option to share my state/pillar files accross multiple masters. Any one have PillarStack working with gitfs? or know that it definitely is possible?
@paul-mulvihill, I'm wondering if you could use salt:// paths that would allow PillarStack to read from git clone? I'd be interested to see the two working together.
@mlalpho not sure how well that would work for the setup i am going for.. I'm intending to have the top.sls file become an automatically generated file as well down the line so given the pillarstack lives on the master that wouldn't work. I have a system of records that i'm aiming to create most of the pillar files and then potentially this one as the hierarchy expands.
From what I've read the PillarStack would have access to the pillar variable, so if you have some things defined in your git pillar, you can operate with them using jinja within PillarStack, which, is something you can't do with normal salt pillars at the moment without using jinja templating and loading yaml, json etc in to a jinja var. Aside from the merging of pillar data as a whole, that's already a big win in my opinion.
I'm refering to the pillar top.sls. my setup is gitfs for everything with seperate repos for states and pillars. Eventually i'm goign to have our system of records generate the top.sls file for pillar information,
In my setup the state\top.sls reads the "appliedstate" grain I define and uses it's values to apply states.
I want to avoid any key configuration being installed on the masters except for telling them to look at gitfs. I'd rather changes to the pillar hierarchy or values are purely within the repo.
By using PillarStack you do get nice merging strategies, but you lose out on being able to use them with other ext_pillar sources, like git_pillar or pillar_ldap.
It would be nice if the merging strategies that PillarStack offers were part of the 'core' pillar code.
:( guessed it would be something like that.. for the scale i'm building a salt estate I need git as the backend, so i'll have to find a work around until we can get this sort of features in the core code.
PillarStack author here: personally I'm also storing my pillar and states data in git (on bitbucket private repositories), and I'm using a docker container to automatically update my pillar and states tree when a new commit is pushed to bitbucket (new commits trigger POST web hook requests to my docker container which update the relevant pillar or states tree).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Corerelates to code central or existential to SaltFeaturenew functionality including changes to functionality and code refactors, etc.P1Priority 1Pillarstale
Activity
thatch45 commentedon Mar 7, 2013
This can get very complicated because pillar data is not structured like state data, but it should be a viable thing to add, I have set this to 0.15.0, but it might get bumped if it proves too complicated
inthecloud247 commentedon Mar 25, 2013
+1*10^3 :-)
alexy commentedon Mar 25, 2013
Default should be simple, and the current behavior -- overwrite -- is fine for the default. At least you can control it with the order of include's. Union will change arity of the data, which becomes problematic for nested structures.
Let's define a uniform convention and have tests which will demonstrate each case. Then the tests can serve as the docs on include/extend behaviors.
Mrten commentedon Apr 5, 2013
ran into this today, wanted to extend a network setting pillar with another one derived from the first and was puzzled why the data was missing.
+1 from me!
eugenea commentedon Apr 12, 2013
+1 Please make some way of mixing data structures. Otherwise it is impossible to manage complicated structures such as access lists without lots of CUT & PASTE.
ConsoleCatzirl commentedon May 14, 2013
Another +1 here. I tend to use the top level pillar object name for scoping the pillar data and would like to be able to extend the object with more data from another pillar file.
inthecloud247 commentedon May 14, 2013
pillar of pillars :-)
awerner commentedon Jun 5, 2013
+1 from me, avoids tedious copying/maintenance of long lists (e.g. users) with only some different entries.
boltronics commentedon Jun 21, 2013
+1. Forcing us to have unique IDs is making our state configuration messy and difficult to maintain.
thatch45 commentedon Jun 21, 2013
Yes, I am sorry we keep pushing this off, we will get it in!
l2ol33rt commentedon Jun 28, 2013
This seems to be a duplicate of an older issue I posted #2466. But I am still really looking forward to this being added in 17.0!
johnnoone commentedon Jul 8, 2013
I posted a proposal about include/extend issues on #2466. Eventually we can use the same logic for top files ?
anitakrueger commentedon Oct 2, 2013
+1 forced to use unique id's is giving me a long complicated pillar dict for a server. and the state configuration now needs to look for different keys, where it could just loop through one if pillar dicts were extensible.
luizsilva commentedon Oct 8, 2013
+1 If pillars could have "defaults" then my life would be easier.
62 remaining items
paul-mulvihill commentedon Jun 15, 2016
Thanks @genuss. reading through the page it looks like it would do what i want.. although one thing I'm unsure about is the following line in the PillarStack Configuration Files section
"The path of these yaml files must be relative to the directory of the PillarStack config file."
This would imply that it only works if the pillar yaml files are locally on the salt master with the pillarstack config file?
I'm using the gitfs option to share my state/pillar files accross multiple masters. Any one have PillarStack working with gitfs? or know that it definitely is possible?
mlalpho commentedon Jun 16, 2016
@paul-mulvihill, I'm wondering if you could use salt:// paths that would allow PillarStack to read from git clone? I'd be interested to see the two working together.
paul-mulvihill commentedon Jun 17, 2016
@mlalpho not sure how well that would work for the setup i am going for.. I'm intending to have the top.sls file become an automatically generated file as well down the line so given the pillarstack lives on the master that wouldn't work. I have a system of records that i'm aiming to create most of the pillar files and then potentially this one as the hierarchy expands.
mlalpho commentedon Jun 17, 2016
The salt/top.sls or pillar/top.sls ?
From what I've read the PillarStack would have access to the pillar variable, so if you have some things defined in your git pillar, you can operate with them using jinja within PillarStack, which, is something you can't do with normal salt pillars at the moment without using jinja templating and loading yaml, json etc in to a jinja var. Aside from the merging of pillar data as a whole, that's already a big win in my opinion.
paul-mulvihill commentedon Jun 17, 2016
I'm refering to the pillar top.sls. my setup is gitfs for everything with seperate repos for states and pillars. Eventually i'm goign to have our system of records generate the top.sls file for pillar information,
In my setup the state\top.sls reads the "appliedstate" grain I define and uses it's values to apply states.
I want to avoid any key configuration being installed on the masters except for telling them to look at gitfs. I'd rather changes to the pillar hierarchy or values are purely within the repo.
mrichar1 commentedon Jul 5, 2016
By using PillarStack you do get nice merging strategies, but you lose out on being able to use them with other ext_pillar sources, like git_pillar or pillar_ldap.
It would be nice if the merging strategies that PillarStack offers were part of the 'core' pillar code.
paul-mulvihill commentedon Jul 5, 2016
:( guessed it would be something like that.. for the scale i'm building a salt estate I need git as the backend, so i'll have to find a work around until we can get this sort of features in the core code.
danlsgiga commentedon Jul 5, 2016
You can have this very same feature using the slsutil.merge module. Here is a snippet to place in your map.jinja:
With that you'll have a full merged dict including lists.
bbinet commentedon Jul 5, 2016
PillarStack author here: personally I'm also storing my pillar and states data in git (on bitbucket private repositories), and I'm using a docker container to automatically update my pillar and states tree when a new commit is pushed to bitbucket (new commits trigger POST web hook requests to my docker container which update the relevant pillar or states tree).
Here is the docker container I'm using:
https://github.com/bbinet/docker-hooked-git-workdir
sdemura commentedon Nov 11, 2016
Ran into this today. Would love to see this implemented at some point!
stale commentedon Jul 24, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
hramrach commentedon Jul 23, 2024
AFAICT it's still broken, although not deterministically.
Sometimes things are merged, sometimes replaced. There is no obvious pattern.