ec2_asg: Duplicate subnets specified error

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.

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…

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

  • James

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. :confused: