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

Add the template lookup escaping to the 2.4 porting guide #32760

Merged
merged 3 commits into from
Nov 12, 2017

Conversation

abadger
Copy link
Contributor

@abadger abadger commented Nov 9, 2017

SUMMARY

This change can break playbooks so make sure we include it in the porting guide.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME
ANSIBLE VERSION
devel and 2.4

@abadger abadger added this to Blocker in 2.4.x Blocker List Nov 9, 2017
@ansibot
Copy link
Contributor

ansibot commented Nov 9, 2017

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 docs_pull_request needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 9, 2017
Template lookup plugin
----------------------

Prior to Ansible 2.4, the strings passed to the template lookup plugin would have backslashes
Copy link
Contributor

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
Copy link
Contributor

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::
Copy link
Contributor

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::
Copy link
Contributor

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:

https://github.com/abadger/ansible/blob/devel/docs/docsite/rst/porting_guide_2.3.rst#openbsd-version-facts

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Nov 9, 2017
@gundalow gundalow removed the needs_triage Needs a first human triage before being processed. label Nov 9, 2017
@ansibot
Copy link
Contributor

ansibot commented Nov 9, 2017

The test ansible-test sanity --test rstcheck [?] failed with the following error:

docs/docsite/rst/porting_guide_2.4.rst:144:0: Error in "code-block" directive:

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Nov 9, 2017
@ansibot ansibot removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 9, 2017
Copy link
Contributor

@dharmabumstead dharmabumstead left a comment

Choose a reason for hiding this comment

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

Approved. Thanks @abadger

@abadger abadger merged commit faa74a8 into ansible:devel Nov 12, 2017
@abadger abadger deleted the template-lookup-escaping branch November 12, 2017 22:01
@abadger abadger moved this from Blocker to Done in 2.4.2 in 2.4.x Blocker List Nov 12, 2017
abadger added a commit that referenced this pull request Nov 12, 2017
* Add the template lookup escaping to the 2.4 porting guide
(cherry picked from commit faa74a8)
@ansibot ansibot added docs This issue/PR relates to or includes documentation. and removed docs_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 docs This issue/PR relates to or includes documentation. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
No open projects
2.4.x Blocker List
Done in 2.4.2
Development

Successfully merging this pull request may close these issues.

None yet

4 participants