Support pillar merging, generally#64
Open
mikemol wants to merge 6 commits intosaltstack-formulas:masterfrom
Open
Support pillar merging, generally#64mikemol wants to merge 6 commits intosaltstack-formulas:masterfrom
mikemol wants to merge 6 commits intosaltstack-formulas:masterfrom
Conversation
The flexjoin() macro simplifies support for mergable and composable
structures. All three of these data structures will result in the string
'a s d f'. The third structure, using dicts, also supports pillar merging.
- 'a s d f'
- [ a, s, d, f]
- { a: ~, s: ~, d: ~, f: ~}
Certain configuration items, such as server andserveractive, are comma-delimited lists. The ordering is unimportant, so we can use flexjoin() to join our input data. We can then compose our input data from merged pillars.
The flexcall() macro permits whole-line merged configuration items by
calling a macro for each key in a dict, or by calling a macro for each
item in a list.
These two inputs are equivalent:
- {a: ~, b: ~, c: ~}
- [a, b, c]
Example usage:
{% call(element) flexcall( mydata ) -%}
Here is an element from input: {{ element }}
{% endcall -%}
Example output:
Here is an element from input: a
Here is an element from input: b
Here is an element from input: c
Support pillar merging of UserParameters via flexcall
Use flexcall to support pillar merging for LoadModule and UserParameter lines.
Contributor
Author
|
Bah. I bungled the commit message for 86da726. That one adds LoadParameter support. |
Verify it's actually a list, so NoneTypes etc can't worm their way in.
Contributor
|
Rather than complicating the state, pillar merging can also be handled master side. Since UserParameters are already specified as a list, you can just enable the If you would like more control over the pillar overrides or merges, you can use somehting like pillarstack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #60.
Support for pillar merging for Server, ServerActive, UserParameter and LoadModule.
Existing pillar data should be unaffected by implementation.