-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Add the template lookup escaping to the 2.4 porting guide #32760
Conversation
Template lookup plugin | ||
---------------------- | ||
|
||
Prior to Ansible 2.4, the strings passed to the template lookup plugin would have backslashes |
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.
template lookup plugin would have backslashes
Would have -> must have?
@@ -131,6 +131,28 @@ Developers: | |||
* Any callbacks inheriting from other callbacks might need to also be updated to contain the same documented options | |||
as the parent or the options won't be available. This is noted in the developer guide. | |||
|
|||
Template lookup plugin |
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.
Can we give more or a clue in the heading, perhaps?
Template lookup plugin: Escaping strings
- debug: | ||
msg: '{{ lookup("template", "tpl.j2") }}' | ||
|
||
And the template in :file:`tpl.j2` is:: |
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.
tpl-> template?
|
||
{{ "name surname" | regex_replace("^[^\s]+\s+(.*)", "\1") }} | ||
|
||
Change the template like this:: |
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.
in the 2.3
guide we used the form
OLD In Ansible 2.2 (and earlier)
NEW In Ansible 2.3:
The test
|
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.
Approved. Thanks @abadger
* Add the template lookup escaping to the 2.4 porting guide (cherry picked from commit faa74a8)
SUMMARY
This change can break playbooks so make sure we include it in the porting guide.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION