Alexander Popov
2015-07-12 17:59:41 UTC
I not found answers in documentation, sorry if its lame, it's my first
day with ansible
i'm creating vpc:
ec2_vpc:
state: present
cidr_block: 172.30.0.0/16
subnets:
- cidr: 172.30.3.0/24
az: ..
resource_tags: { "tag" : "tag1" }
- cidr: 172.30.1.0/24
az: "{{ region }}a"
resource_tags: { ""tag" : "tag1" }
register: vpc
its assign value to vpc with array of subnets:
"subnets": [
{
"id": "subnet-zzzzzzz",
"resource_tags": {...
}
.. .
},
{
"id": "subnet-xxxxxxx",
"resource_tags": {...
}
...
}
},
for some other calls I need this subnets in different forms
for example ec2_elb_lb requires list of ids:
subnets:
- subnet-xxxxxxxx
- subnet-zzzzzzzz
How can i convert vpc.subnets array to array of ids? What if i need filter them by tag ?
Does it any analog for map of filter operations in ansible?
day with ansible
i'm creating vpc:
ec2_vpc:
state: present
cidr_block: 172.30.0.0/16
subnets:
- cidr: 172.30.3.0/24
az: ..
resource_tags: { "tag" : "tag1" }
- cidr: 172.30.1.0/24
az: "{{ region }}a"
resource_tags: { ""tag" : "tag1" }
register: vpc
its assign value to vpc with array of subnets:
"subnets": [
{
"id": "subnet-zzzzzzz",
"resource_tags": {...
}
.. .
},
{
"id": "subnet-xxxxxxx",
"resource_tags": {...
}
...
}
},
for some other calls I need this subnets in different forms
for example ec2_elb_lb requires list of ids:
subnets:
- subnet-xxxxxxxx
- subnet-zzzzzzzz
How can i convert vpc.subnets array to array of ids? What if i need filter them by tag ?
Does it any analog for map of filter operations in ansible?
--
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+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5fa2bcdc-6c16-4467-99f7-2b2e37026074%40googlegroups.com.
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 ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5fa2bcdc-6c16-4467-99f7-2b2e37026074%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.