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
There is acctually a closed pull req from about a year ago that does this that I did not merge at the time which I am not regrettign not merging. But I have been unable to find it to see how they pulled it off for re-evaluation
Hi. I am currently working on introducing a new option overlap into pillar inclusion system.
The idea behind is that sometimes we need to aggregate datas over SLS files in order to reuse them in jinja loops. Or replace them, etc.
update: this is the default, included keys overlap top keys
merge: top keys overlap included keys
extend: every overlapping keys will be merged if they are list or dict. Otherwise an error will be raised (in order to avoid messy pillar definitions).
Sounds really cool. I'm not sure that the merge and update examples you gave are entirely clear. I would expect a merge to include all keys, and if there are duplicates it will turn the key value into a list. And for update it would combine the keys but eliminate duplicates by assigning the newest value where there is a conflict. Looks like a cool idea! Excited to see this progress.
We recently had some updates to the include statement sta might solve this, since they allow for things to be included at the right times, lemme look up the pull that added it
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.
Activity
thatch45 commentedon Nov 6, 2012
Thanks for filing this!We will get this added.
vad commentedon Apr 30, 2013
updates?
thatch45 commentedon Apr 30, 2013
There is acctually a closed pull req from about a year ago that does this that I did not merge at the time which I am not regrettign not merging. But I have been unable to find it to see how they pulled it off for re-evaluation
jacobsvante commentedon Jun 9, 2013
+1! This would be an awesome feat.
johnnoone commentedon Jul 8, 2013
Hi. I am currently working on introducing a new option overlap into pillar inclusion system.
The idea behind is that sometimes we need to aggregate datas over SLS files in order to reuse them in jinja loops. Or replace them, etc.
the development is available here https://github.com/johnnoone/salt/tree/pillar-extended
Here the specs:
overlap accepts 3 values :
Consider this example.
When {{ STRATEGY }} is merge
When {{ STRATEGY }} is update
When {{ STRATEGY }} is extend
Any suggestion are welcome.
inthecloud247 commentedon Jul 8, 2013
Sounds really cool. I'm not sure that the merge and update examples you gave are entirely clear. I would expect a merge to include all keys, and if there are duplicates it will turn the key value into a list. And for update it would combine the keys but eliminate duplicates by assigning the newest value where there is a conflict. Looks like a cool idea! Excited to see this progress.
qfel commentedon Jul 12, 2013
Slightly different approach to the problem:
I'm currently just using a custom renderer:
SLS files referenced from top.sls use
#!jinja|yaml|merge
Where merge expects a list of dicts and produces a dict.
So a file like
renders to
{"a": 3, "b": 2}Works quite well in practice and is very customizable (you can choose the strategy depending on the suffix of a key name).
thatch45 commentedon Jul 12, 2013
We recently had some updates to the include statement sta might solve this, since they allow for things to be included at the right times, lemme look up the pull that added it
l2ol33rt commentedon Jul 16, 2013
Thanks for the update Tom!
pkruithof commentedon Aug 7, 2013
👍 I would really like this
PinGwynn commentedon Aug 27, 2013
a very necessary functionality
TronPaul commentedon Feb 1, 2014
Include does not solve my particular use case. Would love to see an extend so I can combine pillar files simply.
johnnoone commentedon Feb 19, 2014
Check my last proposal for this problem #3991 (comment)
JensRantil commentedon Apr 11, 2014
👍 This would be a very much appreciated feature.
stale commentedon Jul 6, 2017
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.