# Ansible ec2\_facts outputs null

**URL:** <https://forum.ansible.com/t/ansible-ec2-facts-outputs-null/18042>\
**Category:** Ansible Project\
**Created:** [April 21, 2015, 6:52pm UTC](https://forum.ansible.com/t/ansible-ec2-facts-outputs-null/18042 "2015-04-21T18:52:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [April 21, 2015, 6:52pm UTC](https://forum.ansible.com/t/ansible-ec2-facts-outputs-null/18042/1 "2015-04-21T18:52:29Z")

</div>

Hi,

I am currently working on using Ansible for implementing rolling upgrade feature.

I was trying to gather ec2\_facts using dynamic inventory however it outputs null and is not able to gather any information

command used:

```auto
 ansible localhost -i ec2.py -m ec2_facts 

```

OUTPUT

```auto
localhost | success >> {
"ansible_facts": {
    "ansible_ec2_public-key": null,
    "ansible_ec2_public_key": null,
    "ansible_ec2_user-data": null,
    "ansible_ec2_user_data": null
},
"changed": false
}

```

If I am trying it using

```auto
 ansible all -i ec2.py -m ec2_facts 

```

I recieve the following OUTPUT

```auto
No hosts matched

```

Can anyone point out what I am missing here ? Thanks

I am able to get host information if I am doing

`  
./ec2.py --list

`

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 30, 2015, 2:48pm UTC](https://forum.ansible.com/t/ansible-ec2-facts-outputs-null/18042/2 "2015-04-30T14:48:17Z")

</div>

can you show the output of:

ansible all -i ec2.py -m ec2\_facts --list-hosts
