You should use the "wait=yes" (or "wait: yes" in the form you've specified
above) option to tell Ansible to wait until the VPC is in the "available"
state before returning.


On Wed, Apr 2, 2014 at 4:49 AM, Chinmaya Patanaik <
[email protected]> wrote:

> Hi,
>
> I created a vpc using ec2_vpc module. Now after the VPC is being created,
> I would like to tag it using ec2_tag module.
>
> ---
> - name: Playbook to create an AWS VPC
>   hosts: local
>   connection: local
>   tasks:
>      - name: Creating a VPC
>        action:
>           module: ec2_vpc
>           state: present
>           aws_access_key: XXXX
>           aws_secret_key: XXXX
>           region: us-east-1
>           cidr_block: 172.23.0.0/16
>           instance_tenancy: default
>           dns_hostnames: yes
>           dns_support: yes
>       register: new_vpc
>
>  - name: Tag the newly Created VPC
>    action:
>      module: ec2_tag
>          aws_access_key: XXXX
>          aws_secret_key: XXXX
>          region: us-east-1
>          state: present
>          resource: '{{item.id}}'
>      args:
>          tags:
>             Name: TestVPC101
>      with_items: new_vpc
>
> But when I executed the playbook, the tagging task failed saying item
> resource not found.
>
>
>
>  --
> 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/a9464844-698e-4164-bee4-76265eed413c%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/a9464844-698e-4164-bee4-76265eed413c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAFg%2Bn8SAcEceqqw78vCS%3D0rcU23MerDMnE4Fc0A%3DDdB4-H7WaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to