# ec2\_asg: Duplicate subnets specified error

**URL:** <https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798>\
**Category:** Ansible Project\
**Created:** [March 20, 2015, 11:39am UTC](https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798 "2015-03-20T11:39:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arangel\_Angov](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Arangel\_Angov](https://forum.ansible.com/u/Arangel_Angov)\
**Post date:** [March 20, 2015, 11:39am UTC](https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798/1 "2015-03-20T11:39:52Z")

</div>

Hello,

I wasn’t able to find any reference to this so far so here it goes:

I have a playbook that creates a new autoscaling group

ec2\_asg:  
name: “{{ asg\_name }}”  
region: “us-east-1”  
availability\_zones: “us-east-1b,us-east-1c,us-east-1d,us-east-1e”  
vpc\_zone\_identifier: [‘subnet-xxxxxxxx’, ‘subnet-xxxxxxxx’, ‘subnet-xxxxxxxx’, ‘subnet-xxxxxxxx’]  
launch\_config\_name: “xxxxxxxx-{{ unique\_id }}”  
health\_check\_period: 60  
health\_check\_type: ELB  
min\_size: 2  
max\_size: 8  
desired\_capacity: 2  
replace\_all\_instances: yes  
load\_balancers: “{{ load\_balancer }}”  
wait\_timeout: 600

I’m getting the following error on the task when running the playbook:

msg: BotoServerError: 400 Bad Request  
  
  
Sender  
`ValidationError`  
Duplicate subnets specified: [x, x, x, x, ', ', s, u, b, n, e, t, -, x, x, x, x, ,x x, ', ', s, u, b, n, e, t, -, x, x, x, x, x, ', ', s, u, b, n, e, t, -, x, x, x, x, x, x, ']  
  
xxxxxxxxxxxxxxxxxxxxxxx

I’ve double-checked my subnets and they are unique.

According to the example in the documentation, the value for vpc\_zone\_identifier should always be a list.

Anyone seen this before or now with Ansible 1.8.4?

Thanks.

---

<div class="post-metadata">

**Author:** ![Will\_Vaughn](https://avatars.discourse-cdn.com/v4/letter/w/779978/32.png) [@Will\_Vaughn](https://forum.ansible.com/u/Will_Vaughn)\
**Post date:** [March 22, 2015, 5:16am UTC](https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798/2 "2015-03-22T05:16:30Z")

</div>

I am getting the same problem. Ansible seems to be iterating over each letter in a subnet id looking for duplicate letters. Not very helpful validation. You would think unit tests would catch this before deployment, but they probably used a string that has no duplicate letters…

---

<div class="post-metadata">

**Author:** ![James\_Martin](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@James\_Martin](https://forum.ansible.com/u/James_Martin)\
**Post date:** [March 22, 2015, 9:42pm UTC](https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798/3 "2015-03-22T21:42:32Z")

</div>

This should be patched in 1.9 RC2. [https://github.com/ansible/ansible-modules-core/issues/967](https://github.com/ansible/ansible-modules-core/issues/967)

- James

---

<div class="post-metadata">

**Author:** ![Will\_Vaughn](https://avatars.discourse-cdn.com/v4/letter/w/779978/32.png) [@Will\_Vaughn](https://forum.ansible.com/u/Will_Vaughn)\
**Post date:** [March 24, 2015, 2:26am UTC](https://forum.ansible.com/t/ec2-asg-duplicate-subnets-specified-error/17798/4 "2015-03-24T02:26:34Z")

</div>

Looking at PR’s its pretty clear there isn’t unit test coverage for most of the modules, is that really correct? I really think they existed hooked up CI tool you’d catch things like this earlier.

I know I sound like an asshole harping on this. Ansible really is a solid project and I’ve liked it at times, but when you’re trying to get some infrastructure spun up and you get stuck looking at release candidate fixes on google groups and github issues pages every time you try to do something. You start reflecting on the fact that this tool was supposed to make configuration management easier for you. 😕
