-
Notifications
You must be signed in to change notification settings - Fork 113
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
feat(map): update to v5 map.jinja
#134
feat(map): update to v5 map.jinja
#134
Conversation
@baby-gnu I'm really glad that you've provided this PR. It's unfortunate that I'm in a busier patch than usual, so that I'm unable to review it so far. Hopefully, I'll get time over the coming days. Thanks again! |
@baby-gnu I finally got a chance to test this on top of the latest changes I've made to the
local:
Data failed to compile:
----------
Rendering SLS 'base:openvpn._mapdata' failed: Jinja error: do_indent() got an unexpected keyword argument 'first'
/tmp/kitchen/var/cache/salt/minion/files/base/openvpn/libmatchers.jinja(61):
---
[...]
"query_method": query_map[_defaults["query_type"]],
"query_delimiter": _defaults["query_delimiter"],
"query": matcher
}
) %}
{%- do salt["log.debug"]( <======================
log_prefix
~ "use built-in defaults for matcher:\n"
~ parsed | yaml(False) | indent(4, first=True)
) %}
.. versionchanged:: 2.10
Blank lines are not indented by default.
Rename the ``indentfirst`` argument to ``first``.
Unfortunately, since |
Thanks a lot for this review, I'll look how to make the code compatible with all versions. |
5eb57cb
to
a29fe55
Compare
Strange, I thought that the new Any idea @myii? |
a29fe55
to
5516658
Compare
I sorted the |
I rebased the branch with final version of |
@baby-gnu The changes haven't been pushed here yet, though? |
5516658
to
746c589
Compare
Yes, I pushed my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some initial queries about if our new map.jinja
solution can allow formula-specific "extra" Jinja to be provided, instead of moving the Jinja into our YAML files.
3759287
to
e74a757
Compare
Hello @myii. I added:
each file must return a valid YAML content to be merged by I think we could event generalise the process: for each In this formula, this will result in:
If you agree, I can make a new commit to show how this will behave. |
0b078a7
to
a2a6548
Compare
I made commits to explore the automatic load of sample of debug log
|
a2a6548
to
a734b08
Compare
Now, the It can manipulate the {%- do salt["log.debug"]("User defined post map.jinja manipulation") %} Which produce the following log:
When no
|
I need to update the |
a734b08
to
77c60f2
Compare
I updated the documentation, I'll rebase the commits when it's OK to merge. Thanks. |
b6ac61b
to
39006a0
Compare
39006a0
to
01edab6
Compare
BREAKING CHANGE: `map.jinja` now export a generic `mapdata` variable BREAKING CHANGE: The parameters per grains are now under `openvpn/parameters/`
For each `.yaml` file that `map.jinja` try to load, a `.yaml.jinja` Jinja template is tried right after to permit jinja manipulation of values and circumvent yamllint errors when using Jinja in YAML files. At the end of the load of YAML files and Jinja YAML templates, `map.jinja` include an optional `post-map.jinja` for post-processing the `mapdata` variable.
722a47a
to
4db7d6f
Compare
I think I finished the rebase of that PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a significant milestone, thanks for your perseverance, @baby-gnu!
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
?Yes.
BREAKING CHANGE:
map.jinja
now export a genericmapdata
variableBREAKING CHANGE: The parameters per grains are now under
openvpn/parameters/
Related issues and/or pull requests
Describe the changes you're proposing
Use the under reviewing v5
map.jinja
:libmatchers.jinja
)map.jinja
configurable by loading the globalsalt://parameters/map_jinja.yaml
and the per formulasalt://{{ tplroot }}/parameters/map_jinja.yaml
(managed by the newlibmapstack.jinja
)libmapstack.jinja
map.jinja
configuration to avoid the merge of values fromsalt["config.get"]("openvpn")
like it was done previouslyPillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context