On 4/24/24 4:01 PM, [email protected] wrote:
Well, the set_fact is supposed to only register or select anything
where the size parameter of the files attributes is 0. The ones that
are printing just [] don't fit that criteria, and therefore, shouldn't
be included in the debug output. Yet they are, so that's what I'm
trying to fix/clean up first.
The ansible.builtin.find module always returns a list.
You're doing an ansible.builtin.set_fact on all the hosts, the value of
which is a subset of that list.
But that, too, is a list, even if it is an empty list.
So you'll get an empty list for any host where either (a) no
/var/log/messages file was found (not likely), or (b) where
/var/log/messages is not zero-length.
But there's nothing in your first few tasks to preclude
ansible.builtin.debug from showing these very real and very much there
empty lists.
--
Todd
--
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/e9029f06-fda5-418c-acdc-9cf23936fcf8%40gmail.com.