# Ansible Create AMI and Copy AMI - Tagging Doesn't always work

**URL:** <https://forum.ansible.com/t/ansible-create-ami-and-copy-ami-tagging-doesnt-always-work/21714>\
**Category:** Ansible Project\
**Created:** [June 9, 2016, 3:14am UTC](https://forum.ansible.com/t/ansible-create-ami-and-copy-ami-tagging-doesnt-always-work/21714 "2016-06-09T03:14:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![einar.coutin](https://avatars.discourse-cdn.com/v4/letter/e/34f0e0/32.png) [@einar.coutin](https://forum.ansible.com/u/einar.coutin)\
**Post date:** [June 9, 2016, 3:14am UTC](https://forum.ansible.com/t/ansible-create-ami-and-copy-ami-tagging-doesnt-always-work/21714/1 "2016-06-09T03:14:11Z")

</div>

Hello,

I’m trying to use Ansible to create an AMi out of an EC2 instance and tag it with NAME: AMI\_NAME and then copy it over to another region and do the same thing (TAG it with NAME) to ultimately add it to a Launch Configuration for an ASG.  
Common sense would indicate that doing and AMI find operation between those things (they’re running asynchronously as fire and forget) would return results but FIND keeps failing in both cases. I’m noticing that at random times each AMI gets its real AMI\_NAME field populated by the NAME tag doesn’t, this creates a problem for FIND because I’m using tags to find them. I’ve discovered too that using the ami\_name in the FIND function doesn’t return any results.

Luckily there are “hacky” ways around this by using the dictionary variables that are registered by the async module as a way to find the AMI ids but the fact that Tags don’t work at random and that you need to use tags in the find module worries me. I’m wondering if anyone else has experienced these things. The python code for find doesn’t seem to indicate tags are necessary but in my experience they do.
