I have this command that lists all the ansible facts:
ansible localhost -m setup
and it listed all the facts of my system. But when I tried to filter them out, i ended up getting the following error:
ansible localhost -a "echo {{ ansible_facts.ansible_date_time.date }}"
localhost | FAILED => One or more undefined variables: 'ansible_facts' is undefined
Why is this happening when the fact or variable already exists?