Try using ansible_ssh_host instead:

vm2     ansible_ssh_host=192.168.104.102


On Monday, 12 October 2015 15:14:03 UTC+2, Wee Sritippho wrote:
>
> I'm reading the inventory document 
> <http://docs.ansible.com/ansible/intro_inventory.html#hosts-and-groups> 
> but can't follow this example:
>
> Suppose you have just static IPs and want to set up some aliases that live 
>> in your host file, or you are connecting through tunnels. You can also 
>> describe hosts like this:
>>
>>  
>>
>> jumper ansible_port=5555 ansible_host=192.168.1.50
>>
>>
> Here is my */etc/ansible/hosts* file:
>
> vm1     ansible_host=localhost  ansible_connection=local
>> vm2     ansible_host=192.168.104.102
>>
>
> When I tried to ping every host, I got this error message for *vm2*:
>
> *vagrant@vm1:~$* ansible all -m ping
>> vm2 | FAILED => SSH Error: ssh: Could not resolve hostname vm2: Name or 
>> service not known
>> It is sometimes useful to re-run the command using -vvvv, which prints 
>> SSH debug output to help diagnose the issue.
>> vm1 | success >> {
>>     "changed": false,
>>     "ping": "pong"
>> }
>>
> How can I set an alias for static IP 192.168.104.102 ?
>
>

-- 
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/ea975623-0ef3-4963-b4b9-a215de317f6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to