# aws ec2 module - count\_tag creating more instances than required

**URL:** <https://forum.ansible.com/t/aws-ec2-module-count-tag-creating-more-instances-than-required/19352>\
**Category:** Ansible Project\
**Tags:** ubuntu, aws\
**Created:** [September 25, 2015, 11:26am UTC](https://forum.ansible.com/t/aws-ec2-module-count-tag-creating-more-instances-than-required/19352 "2015-09-25T11:26:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Black1](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Adrian\_Black1](https://forum.ansible.com/u/Adrian_Black1)\
**Post date:** [September 25, 2015, 11:26am UTC](https://forum.ansible.com/t/aws-ec2-module-count-tag-creating-more-instances-than-required/19352/1 "2015-09-25T11:26:38Z")

</div>

Hi  
Possibly im not using this correctly.  
Here is the playbook snippet

```auto
        key_name: "{{ aws_key_name }}"
        instance_type: "{{ cms_machine_type }}"
        image: "{{ aws_vm_image }}"
        wait: yes
        exact_count: 1
        count_tag: 
          role:cms
        group_id: "{{ aws_cms_security_group_id }}"
        region: "{{ aws_region }}"
        monitoring: yes
        assign_public_ip: yes
        vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
        instance_tags:
           role: cms
           has_shared: true
      register: 

```

```auto

```

I want only a single instance create with role = cms but the above creates another instance each time its run so am i doing something wrong with this syntax?

Ansible version = 1.9.3 on Trusty Ubuntu

Thanks

```auto

```

```auto

```

This message is private and confidential and for the exclusive use of the intended recipient(s). If you receive this email in error, please notify the sender immediately and delete all copies from your system. If you are not the intended recipient disclosure, distribution, copying or use of this communication is strictly prohibited. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of IDG UK. Clients and suppliers can view our full terms and conditions at [www.idg.co.uk/terms-and-conditions/](http://www.idg.co.uk/terms-and-conditions/)

IDG Communications Ltd. Company Reg No: 1197840. Registered in England and Wales.

![](https://38a59822-a-1dc0f5c6-s-sites.googlegroups.com/a/mediaagility.com/logosample/home/signature_logo.png?attachauth=ANoY7crF4nk0shraBTx4egPsjJyrp3hC78zf5cb9iD719llYD_7amCNV8EBsLI0G5OAQXrh0Wvugf6Y9o_4GYexODCE-ORMGf3_GljRALPKL9-Zo8UL2JMKSS_YvSPbsX3ISg6h2MO3HG4weKT7hpZbUH8G9Y9su2mdAjluFHWD8ahhJc8teJHsGaARHQMOc3LVuANkGz1U-xLFI9Y0lhmQw0wFEudYxIiLsr0LxPw4teDhn2fMOiQU%3D&attredirects=0)

---

<div class="post-metadata">

**Author:** ![Adrian\_Black1](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Adrian\_Black1](https://forum.ansible.com/u/Adrian_Black1)\
**Post date:** [September 25, 2015, 12:30pm UTC](https://forum.ansible.com/t/aws-ec2-module-count-tag-creating-more-instances-than-required/19352/2 "2015-09-25T12:30:49Z")

</div>

White space issue.

```auto
count_tag:  

```

role: cms

seemed to fix it.
