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

On 16 March 2016 at 10:14, Michael Baydoun <[email protected]> wrote:

> Wouldn't I still need to register the output and extract the vpc_id for
> use in subsequent subnet, security group, and other tasks.
>
> On Wednesday, March 16, 2016 at 12:39:16 PM UTC-4, Stephen Granger wrote:
>>
>> Have you looked at the Ansible 2.0 modules for deploying a VPC and
>> subnets? It may simplify the setting of facts. I don't have time to give
>> you an example at the moment but have found the new modules a lot easier to
>> use.
>>
>> http://docs.ansible.com/ansible/ec2_vpc_net_module.html
>>
>>
>> --
> 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/22f46234-c6e9-43cf-bc1d-6915cfd69ee4%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/22f46234-c6e9-43cf-bc1d-6915cfd69ee4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Steve

-- 
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/CA%2BemtqvX%2Bh7oAgS8Ni%3DdcLqJFyrtqRDS2_ZPZr3%2B14inLf-sdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to