this module does not seem to be idempotent. Here is the documentation: 
http://docs.ansible.com/ansible/ec2_vpc_module.html,  which seems to 
indicate that VPC's will NOT be created if a VPC already exists with 
equivalent resource_tags and cidr_block values. 

Unfortunately, as many times as I run this role, it will create a new VPC. 

Here is my usage: 
- name: create vpcs
  ec2_vpc:
    state: '{{ item.state }}'
    region: '{{ item.region }}'
    vpc_id: '{{ item.vpc_id }}'
    cidr_block: '{{ item.cidr_block }}'
    resource_tags: { "Name": "{{item.name}}" }
    subnets: '{{ item.subnets }}'
    internet_gateway: '{{ item.internet_gateway }}'
    route_tables:
      - subnets: '{{ item.route_tables.private_subnets.subnets }}'
        routes:
          - dest: '{{ item.route_tables.private_subnets.routes.dest }}'
            gw: '{{ item.route_tables.private_subnets.routes.gw }}'
      - subnets: '{{ item.route_tables.public_subnets.subnets }}'
        routes:
          - dest: '{{ item.route_tables.public_subnets.routes.dest }}'
            gw: '{{ item.route_tables.private_subnets.routes.gw }}'
  with_items: vpcs
  register: vpc

Thanks for any help/guidance. 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/22c55a76-099c-45a6-9faf-3556b647ea4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to