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 #43294pull/44492/head
parent
6982dfc756
commit
bda074d34e
@ -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