mirror of https://github.com/ansible/ansible.git
fix no log templating (#44506)
* 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 bda074d34e)
* use play context to avoid bug when jinja2+py3
pull/44522/head
parent
499ddeadd5
commit
b0678e71a8
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- always correctly template no log for tasks https://github.com/ansible/ansible/issues/43294
|
||||
@ -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) }}"
|
||||
Loading…
Reference in New Issue