Properly handle items with a false condition
This commit is contained in:
parent
3b4169bafb
commit
460802d02e
@ -37,11 +37,16 @@
|
||||
debug:
|
||||
verbosity: 1
|
||||
msg: |
|
||||
{% if item.false_condition is not defined -%}
|
||||
Results of {{ item.cmd | join(' ') }}
|
||||
{{ item.stdout | default(item.msg | default('No message')) }}
|
||||
|
||||
{% else %}
|
||||
Update of {{ item.item.1 }} skipped due to the following conditional(s) being false
|
||||
* {{ item.item.2 }} == 'up'
|
||||
* {{ item.item.3 }} == {{ ansible_distribution_version }}-RELEASE
|
||||
{% endif -%}
|
||||
loop: '{{ installupdates_iocage.results }}'
|
||||
loop_control:
|
||||
label: '{{ item.cmd | join(" ") }}'
|
||||
label: 'Update of {{ item.item.1 }}'
|
||||
when: installupdates_iocage
|
||||
when: iocage_available.stat.exists
|
||||
|
Loading…
x
Reference in New Issue
Block a user