Thanks Benno, that worked!

– Viktor

On Monday, June 15, 2015 at 2:52:56 PM UTC+2, benno joy wrote:
>
> can you please try " 
>
> vpc_subnets | map(attribute='cidr')| list
>
>
>
> On Sun, Jun 14, 2015 at 2:42 PM, Viktor Szathmáry <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> Let's say I have a variable structure like this:
>>
>> vpc_subnets:
>>   - cidr: *"172.22.1.0/24 <http://172.22.1.0/24>"*
>>     az: "us-east-1a"
>>   - cidr: *"172.22.2.0/24 <http://172.22.2.0/24>"*
>>     az: "us-east-1b"
>>   - cidr: *"172.22.3.0/24 <http://172.22.3.0/24>"*
>>     az: "us-east-1c"
>>
>> ... and a task using it:
>>
>> ec2_vpc:
>>   ...
>>   subnets: "{{ vpc_subnets }}"
>>   route_tables:
>>     - subnets:
>> *        - "172.22.1.0/24 <http://172.22.1.0/24>"*
>> *        - "172.22.2.0/24 <http://172.22.2.0/24>"*
>> *        - "172.22.3.0/24 <http://172.22.3.0/24>"*
>>       routes:
>>         - dest: 0.0.0.0/0
>>           gw: igw
>>
>>
>> I would like to avoid repeating the CIDRs in route_tables/subnets, and 
>> just select all the CIDRs from the vpc_subnets variable. Is there a nice 
>> way of doing this?
>>
>> Thanks,
>>   Viktor
>>
>>  -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/b538a1bc-b45d-4535-947c-c3940a3d80dc%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/b538a1bc-b45d-4535-947c-c3940a3d80dc%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/9fcf503a-a425-4556-84ac-38c3615998ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to