Thank you Vladimir! I had already gotten the selectattr piece working but the length check was the missing piece. All good now.
Thanks, Harry On Wed, Sep 27, 2023, 3:32 PM Vladimir Botka <[email protected]> wrote: > Map the attribute > > dn: "{{ ansible_mounts| > selectattr('device', 'contains', 'nas-server.example.com')| > map(attribute='device') }}" > > If you want to skip empty lists test the length > > - debug: > var: dn > when: dn|length > 0 > > -- > 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/CALYKJ26GFhRywku%3DSCMnsPsJ%2BifP888zPGHBQYv7AEwGxEQdwQ%40mail.gmail.com.
