On Thu, 25 Jun 2020 13:05:23 -0400
Brian Coca <[email protected]> wrote:

> something like (might need to tweak syntax to get right):
> when: not select(result[|deault({'results': []}, 'success' )|list
> will skip the rest of the iterations once one succeeds

Thank you very much! I got it. For example

    - command: '[ "{{ item }}" -gt "3" ]'
      loop: "{{ range(1, 5 + 1)|list }}"
      register: result
      ignore_errors: true
      when: not condition
      vars:
        condition: "{{ (result|default({'rc': 1})).rc == 0 }}"

gives

    changed: [localhost] => (item=4)
    skipping: [localhost] => (item=5) 
    ...ignoring


-- 
Vladimir Botka

-- 
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/20200625231256.0baadba4%40gmail.com.

Attachment: pgpvSLW1zm4sV.pgp
Description: OpenPGP digital signature

Reply via email to