Skip to content

Commit

Permalink
restore inadvertently deleted default for convert_data. Fixes #77004 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Feb 14, 2022
1 parent c9d3518 commit 3779c1f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/77004-restore-missing-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- template lookup - restore inadvertently deleted default for ``convert_data``
(https://github.com/ansible/ansible/issues/77004)
1 change: 1 addition & 0 deletions lib/ansible/plugins/lookup/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
description:
- Whether to convert YAML into data. If False, strings that are YAML will be left untouched.
- Mutually exclusive with the jinja2_native option.
default: true
variable_start_string:
description: The string marking the beginning of a print statement.
default: '{{'
Expand Down
7 changes: 7 additions & 0 deletions test/integration/targets/lookup_template/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
- assert:
that:
- "hello_world_comment|trim == 'Hello world!'"

# 77004
- assert:
that:
- lookup('template', 'dict.j2') is mapping
- lookup('template', 'dict.j2', convert_data=True) is mapping
- lookup('template', 'dict.j2', convert_data=False) is not mapping
1 change: 1 addition & 0 deletions test/integration/targets/lookup_template/templates/dict.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"foo": "{{ 'bar' }}"}

0 comments on commit 3779c1f

Please sign in to comment.