On Fri, 8 Nov 2019 16:55:59 +0100 Vladimir Botka <[email protected]> wrote:
> On Fri, 8 Nov 2019 06:13:10 -0800 (PST) > "'Tobias Kirchhofer' via Ansible Project" <[email protected]> > wrote: > > > > > > > Use *default* and *skip_missing* subelements. For example > > > > > > loop: "{{ FIREWALLD_ZONE_SERVICE|default([])| > > > subelements('SERVICES', skip_missing=True) }}" > > > > Thank you! This is working. Is only needed with 'subelements'. But why? As a result, *default* is better construct loop: "{{ FIREWALLD_ZONE_SERVICE|default([]) }}" than *when* loop: "{{ FIREWALLD_ZONE_SERVICE }}" when: FIREWALLD_ZONE_SERVICE is defined -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20191108170701.3940044a%40gmail.com.
pgpLyN1OrOhFe.pgp
Description: OpenPGP digital signature
