I previously tried ec2_vpc_net_facts, but it's not available until version 
2.1 (not release yet).

On Wednesday, March 16, 2016 at 2:47:27 PM UTC-4, Stephen Granger wrote:
>
> Yes, but it is also possible to lookup the VPC id. This just gets the 
> default, based on the filters, VPC id.
>
> # Get the vpc id
>     - name: Get the default VPCs details
>       ec2_vpc_net_facts:
>         aws_access_key: "{{ aws_access_key }}"
>         aws_secret_key: "{{ aws_secret_key }}"
>         region: "{{ aws_region }}"
>         filters:
>           is_default: "true"
>       register: returned_vpc
>
>     - name: The VPC id
>       debug:
>         var: returned_vpc.vpcs[0].id
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/07396ff8-1639-42a5-8de2-5a9ecfd6409b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to