Hi,
i think
- debug: msg="{{ group_host_type[inventory_hostname].node_id }}"
should work. I'm not sure if the declaration of group_type is correct,
though. I think it should be:
group_host_type: {
'HOST1': { 'node_id': 0 },
'HOST2': { 'node_id': 1}
}
but it might just be the case that i don't always get yaml and prefer using
curly braces instead of hyphens and intendation ;-)
Karsten
Am Donnerstag, 9. Juni 2016 10:25:43 UTC+2 schrieb Clément VALENTIN:
>
> Hi,
>
> I try to concatenate 2 variables value to form one another variable but i
> don't found how to do this :/
>
> *Exemple:*
>
> group_host_type:
>> - HOST1:
>> node_id: 0
>> - HOST2:
>> node_id: 1
>
>
> I want to use "group_host_type" in playbook with host to use dynamics
> variable according to my server.
>
> *Exemple (doesn't work) :*
>
> - debug: msg="{{ {{ group_hybris_host_type
>> }}.{{ inventory_hostname }}.node_id }}"
>
>
> => Return 0 if on HOST1 server and 1 on HOST2 server.
>
>
> Is it possible ?
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.