Add support to use current node parameters as references in class name#89
Merged
epcim merged 2 commits intosalt-formulas:developfrom Oct 2, 2020
Merged
Conversation
e2d8987 to
17b582b
Compare
bbinet
added a commit
to bbinet/docker-salt-master
that referenced
this pull request
Apr 3, 2020
which includes following fix: salt-formulas/reclass#89
Member
|
LGTM, tentative to merge, will you rebase (anything to add/comment?) ie: update docs? |
so that with the following reclass config:
```
=> /etc/reclass/nodes/mynode.yml
classes:
- common
parameters:
project: myproject
=> /etc/reclass/classes/common.yml
class:
- ${project}
=> /etc/reclass/classes/myproject.yml
parameters:
some:
project: parameters
```
The mynode parameters would be merged successfully by reclass and we will
get the following result for the parameters:
```
parameters:
project: myproject
some:
project: parameters
```
Without this patch, this would result in the following error:
```
Failed to load ext_pillar reclass: ext_pillar.reclass: -> mynode
In yaml_fs:///etc/reclass/classes/common.yml
Class name ${project} not resolvable
```
so that we avoid side effect of list elements being merged twice in the same list. This commit adds a new "scalar_parameters" reclass config option (defaults to False) used to indicate where to find scalar parameters in node parameters dict.
62ed214 to
5656186
Compare
Author
|
@epcim I've just rebased on the latest develop branch. |
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.
so that with the following reclass config:
The mynode parameters would be merged successfully by reclass and we will
get the following result for the parameters:
Without this patch, this would result in the following error: