# Module ec2\_ami\_find does not return data

**URL:** <https://forum.ansible.com/t/module-ec2-ami-find-does-not-return-data/24728>\
**Category:** Ansible Project\
**Tags:** ubuntu, aws\
**Created:** [June 14, 2017, 6:38pm UTC](https://forum.ansible.com/t/module-ec2-ami-find-does-not-return-data/24728 "2017-06-14T18:38:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Bushey](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Michael\_Bushey](https://forum.ansible.com/u/Michael_Bushey)\
**Post date:** [June 14, 2017, 6:38pm UTC](https://forum.ansible.com/t/module-ec2-ami-find-does-not-return-data/24728/1 "2017-06-14T18:38:45Z")

</div>

I am able to spin up servers with the ‘ec2’ module. I’m running Ansible 2.3.1.0 from source on Ubuntu.

╰─➤ dpkg -l | grep -i boto 2 ↵  
ii python-boto 2.40.0-1ubuntu1 all Python interface to Amazon’s Web Services - Python 2.x  
ii python-boto3 1.4.2-1 all Python interface to Amazon’s Web Services - Python 2.x  
ii python-botocore 1.5.7-1 all Low-level, data-driven core of boto 3 (Python 2)

- name: aws | find latest ami for Ubuntu 16.04  
ec2\_ami\_find: name=“ubuntu/images/\*” region=us-west-1 sort=name sort\_order=descending state=availiable no\_result\_action=fail  
register: ami\_find

…  
“msg”: “No AMIs matched the attributes: {"state": "availiable", "name": "ubuntu/images/"}”  
…

same thing if I use “_ubuntu_”. Putting “ubuntu/images/\*” into the AWS us-west-1 console AMI search box results in 7,666 AMIs.

If I remove state=availiable I get:  
“msg”: “template error while templating string: Expected an expression, got ‘end of print statement’. String: {{}}”

Any ideas?

---

<div class="post-metadata">

**Author:** ![Michael\_Bushey](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@Michael\_Bushey](https://forum.ansible.com/u/Michael_Bushey)\
**Post date:** [June 14, 2017, 6:44pm UTC](https://forum.ansible.com/t/module-ec2-ami-find-does-not-return-data/24728/2 "2017-06-14T18:44:39Z")

</div>

If I spell ‘available’ correct I also get the template error.
