Closed baby-gnu closed 4 years ago
I updated my splityaml to puts defaults.yaml
values under a values
key.
I tested this formula with salt-ssh
and it's working fine:
Summary for testmachine3
------------
Succeeded: 8 (changed=7)
Failed: 0
------------
Total states run: 8
Total run time: 60.949 s
:tada: This PR is included in version 3.7.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
https://github.com/saltstack-formulas/template-formula/pull/186
Describe the changes you're proposing
Load the formula parameters values from configurable
map.jinja
sources.The configuration for
map.jinja
comes from:builtin default
osarch
grainos_family
grainos
grainosfinger
grainlookup
table retrived byconfig.get
config.get
id
graindefaults.yaml
: optionally define a formula specificmap_jinja:sources
global configuration lookup
map_jinja:sources
formula specific
<tplroot>:map_jinja:sources
The hard coded default is backward compatible and add the minion id at the end of the list.
If an entry does not match a
salt['config.get']
parameter, it's used as a literal file path (with.yaml
added if it's missing).Each YAML file is formatted with the following top level keys:
values
: contains the the parameter valuesstrategy
(optional): define the merge strategy for the functionsalt.slsutils.merge
(aggregate, list, overwrite, recurse, smart). The default issmart
.merge_lists
(optional): boolean to merge lists or overwrite themIt's possile to configure
config.get
when looking up the formula configuration. You need to define a subkeystrategy
with the following differences from YAML files:strategy
can be one ofNone
, overwrite and recurse. The default isNone
.if you use
salt-ssh
, this merge strategy is skipped and and error log message is emitted.The parameters values are merged in the following order:
initialize default values from
defaults.yaml
merge the values from each source defined by the ordered list
map_jinja:sources
Pillar / config required to test the proposed changes
To test the skipping of the merge configuration of
config.get
when usingsalt-ssh
:Debug log showing how the proposed changes work
When you put a pillar
libvirt:strategy
tooverwrite
, you havesalt-ssh
minion
orsalt-call
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context