Folks, consider the following playbook:
##
- name: Gather facts
action: ec2_facts
- debug: msg="{{ ec2_facts }}"
##
Produces a fatal error: `fatal: [10.1.15.119] => One or more undefined variables: 'ec2_facts' is undefined`
However, It does seem to be pulling in the ec2 metadata:
ok: [10.1.15.119] => {"ansible_facts": {"ansible_ec2_ami_id": "ami-f0091d...
How does one access this metadata instance a playbook? I guess I need help with correct syntax.
Is this correct? {{ ansible_facts.ansible_ec2_ami_id }} ?
Thanks!