mirror of https://github.com/ansible/ansible.git
* 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 commitpull/52546/headbda074d34e
) * use play context to avoid bug when jinja2+py3 (cherry picked from commitb0678e71a8
)
parent
6cf37dc49f
commit
8a61f73098
@ -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