Thanks, that's it. How did you find out? How do I find variables NOT 
defined in setup module?

Am Dienstag, 15. April 2014 11:48:43 UTC+2 schrieb Dick Davies:
>
> Try inventory_hostname . 
>
> On 14 April 2014 09:14, ProfHase <[email protected] <javascript:>> 
> wrote: 
> > Hi, having the following configuration 
> > 
> > [my_hosts] 
> > my_host ansible_ssh_host=123.123.123.123 
> > my_host2 ansible_ssh_host=234.234.234.234 
> > 
> > 
> > I want to gather some debug information in my templates. 
> > 
> > How do I acces the alias variable in a playbook/template? ie: debug: 
> > msg=Myhost is {{ ansible_host_alias }} 
> > # Myhost is my_host 
> > # Myhost is myhost2 
> > 
> > I tried to gather facts using ansible -m setup my_host . The variables 
> > ansible_hostname , HOSTNAME and HOST contain the machine's hostname, 
> i.e. 
> > echo $HOSTNAME which differs from my ansible alias. 
> > 
> > - Is there really no such builtin variable? 
> > 
> > - Would a feature request make sense, or should I better try to keep all 
> my 
> > aliases in ssh_config? 
> > 
> > Thanks :) 
> > 
> > -- 
> > 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/9cff5163-dd72-4285-8465-a69146ee048e%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 [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/b662272d-78bb-4624-b7d2-06b0e72078c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to