-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Merging a list in pillars #28394
Comments
dupe of #3991 ? |
Looks like that is the case. It's cool to close this one out then. |
Strictly speaking, issue #3991 (based on examples in the initial posts here and there) is supposed to solve completely different problem of merging dictionaries. The problem of merging dictionaries is solved as I commented there. If two dictionaries from different pillar files contain conflicting key names, the value of the first one gets overwritten by the second one (however, the order which one is the 1st is not known to me). If there is no key name conflicts, both key-values are simply accepted in the combined dictionary. The problem of merging lists is not solved. Lists are just value objects like strings, numbers, or anything else (except dictionaries which recurse during merging). However, default strategy is not clear:
Dictionaries are more straightforward in this sense as deep merging (with value overwrites in case of conflicting keys) is almost always acceptable default behaviour. Should this issue be reopened and be focused strictly on merging list items? |
I believe so. The idea of having a hierarchical pillar structure is difficult without the Example: /core/packages.sls has list of 14 packages /rabbitmq/packages.sls has 3 more packages If both the core.packages and rabbitmq.packages pillars are applied to the It would be nice if in the actual top.sls we can define if two pillars with On Saturday, November 21, 2015, Alexey Pakseykin [email protected]
|
@ldelossa Technically speaking, I don't feel urge for this feature (and I'm OK if this issue stay closed until something escalates the case). In fact, there is only one unresolved (rare?) need - combining items in the order they appear:
When combined dictionary is traversed, the order of keys is undefined. Lists could solve the order issue. What I really want (just to make public aware to strive for pointful and focused discussion) is:
|
I understand you're point. However to I do believe valueless keys is not an I'm happy with the solution and work around and can live with it, but in my On Saturday, November 21, 2015, Alexey Pakseykin [email protected]
|
I'm noticing that simply merging lists within pillars is not possible. I'm trying to take two pillar files with the following lists:
I would like to apply these two pillars to a minion, and have them merge into one conhesive list.
This seems to be only possible in a hackish way using nested dictionaries. Are there any plans to do this with the simple merge data struct?
This is the structure that will allow merging. I cannot have similar keys anywhere. Also seems to break with Ints.
The text was updated successfully, but these errors were encountered: