ec2_facts return variables with name ansible_ec2*.
If you want to see all variables, try to 
use https://github.com/f500/ansible-dumpall
«{{ ansible_facts.ansible_ec2_ami_id }}» is wrong, use «{{ 
ansible_ec2_ami_id }}».

On Tuesday, December 15, 2015 at 6:39:19 AM UTC+5, Vasiliy Boulytchev wrote:
>
> 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!
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d014440b-eae6-46cc-8fbf-ffbbaca3d582%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to