Skip to content
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

preserv ansible # jinja2 header #263

Merged
merged 1 commit into from
Oct 17, 2023
Merged

preserv ansible # jinja2 header #263

merged 1 commit into from
Oct 17, 2023

Conversation

nbari
Copy link
Contributor

@nbari nbari commented Oct 12, 2023

Preserves the jinja2 ansible headers # jinja2: like: # jinja2:lstrip_blocks: true

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html

Also, you can override jinja2 settings by adding a special header to template file. i.e.
#jinja2:variable_start_string:'[%', variable_end_string:'%]', trim_blocks: False

Useful when using jinja2.ansible:

#jinja2:lstrip_blocks: True
# ----------------------------------------------------------------------------
# {{ ansible_managed }}
# ----------------------------------------------------------------------------
---
global:
  resolve_timeout: 1m'

route:
...

Checklist

  • Add test cases to all the changes you introduce
  • Update the documentation for the changes

Copy link
Owner

@lyz-code lyz-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution :)

@lyz-code lyz-code merged commit 43d95f8 into lyz-code:main Oct 17, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants