I concede..there is no way to do this without passing an extra var at run 
time.

On Friday, August 12, 2016 at 3:49:51 PM UTC-5, Tony Owens wrote:
>
> This works just fine when I set_fact for "manager" on the desired host.
>
>    1. 
>    2. mtoken: "{{ hostvars['myhost.net']['manager'] | replace('[u', '') | 
>    replace(']', '')}}"
>
> but I need to be able to get the name of the single host that is in the 
> group passed with something like this. Perhaps i need to step back and 
> regroup and go about this in a different way. Any tips would be appreciated.
>
>    1. - hosts: "swarm-init-{{ env }}"
>
>
> On Friday, August 12, 2016 at 3:15:42 PM UTC-5, Tony Owens wrote:
>>
>> {{ env }} is an extra-vars in this instance
>>
>> On Friday, August 12, 2016 at 2:59:11 PM UTC-5, Brian Coca wrote:
>>>
>>> hosts: only has access to extra-vars, you cannot get group vars when 
>>> they depend on the hosts you select in hosts: ....
>>>
>>>
>>> ----------
>>> Brian Coca
>>>
>>

-- 
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/10d0173b-438b-466e-8ec5-d88d7b00aa9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to