Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix tempating issues with no_log and loops (#44468) * fix tempating issues with no_log and loops - task is no log if any item is - added test cases fixes #43294 (cherry picked from commit bda074d) * use play context to avoid bug when jinja2+py3
- Loading branch information
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- always correctly template no log for tasks https://github.com/ansible/ansible/issues/43294 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
- name: test dynamic no log | ||
hosts: testhost | ||
gather_facts: no | ||
ignore_errors: yes | ||
tasks: | ||
- name: no loop, task fails, dynamic no_log | ||
debug: | ||
msg: "SHOW {{ var_does_not_exist }}" | ||
no_log: "{{ not (unsafe_show_logs|bool) }}" | ||
|
||
- name: loop, task succeeds, dynamic does no_log | ||
debug: | ||
msg: "SHOW {{ item }}" | ||
loop: | ||
- a | ||
- b | ||
- c | ||
no_log: "{{ not (unsafe_show_logs|bool) }}" | ||
|
||
- name: loop, task fails, dynamic no_log | ||
debug: | ||
msg: "SHOW {{ var_does_not_exist }}" | ||
loop: | ||
- a | ||
- b | ||
- c | ||
no_log: "{{ not (unsafe_show_logs|bool) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters