# Would you please support these style hosts config?

**URL:** <https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299>\
**Category:** Ansible Developer\
**Created:** [January 17, 2015, 12:15am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299 "2015-01-17T00:15:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zixu\_mo](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@zixu\_mo](https://forum.ansible.com/u/zixu_mo)\
**Post date:** [January 17, 2015, 12:15am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/1 "2015-01-17T00:15:25Z")

</div>

Would you please support these style hosts config?

cat /etc/ansible/hosts

`

[webserver]  
david@node1.18m.myserver.com:30182  
smith@109.110.xxx.28  
176.120.13.14:3013

`

---

<div class="post-metadata">

**Author:** ![Jonathan\_Mainguy](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@Jonathan\_Mainguy](https://forum.ansible.com/u/Jonathan_Mainguy)\
**Post date:** [January 17, 2015, 12:18am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/2 "2015-01-17T00:18:10Z")

</div>

There is no need for this, ansible works with ~/.ssh/config, where you can define things like default user and ports per host.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 17, 2015, 12:18am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/3 "2015-01-17T00:18:33Z")

</div>

this is already supported:  
176.120.13.14:3013

this is not  
smith@109.110.xxx.28

currently i has to be written this way:  
109.110.xxx.28 ansible\_ssh\_user=smith  
node1.18m.myserver.com:30182 ansible\_ssh\_user=david

---

<div class="post-metadata">

**Author:** ![zixu\_mo](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@zixu\_mo](https://forum.ansible.com/u/zixu_mo)\
**Post date:** [January 17, 2015, 12:24am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/4 "2015-01-17T00:24:32Z")

</div>

Thanks , learned

zixu mo於 2015年1月17日星期六 UTC+8上午8時15分25秒寫道：

---

<div class="post-metadata">

**Author:** ![zixu\_mo](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@zixu\_mo](https://forum.ansible.com/u/zixu_mo)\
**Post date:** [January 17, 2015, 12:25am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/5 "2015-01-17T00:25:48Z")

</div>

One more question,  
Does ansible support

~/.ansible/hosts or what ever hosts path?

zixu mo於 2015年1月17日星期六 UTC+8上午8時15分25秒寫道：

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 17, 2015, 12:26am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/6 "2015-01-17T00:26:45Z")

</div>

on the command line, -i /whatever/path/you/want, or you can set it in  
ansible.cfg

---

<div class="post-metadata">

**Author:** ![zixu\_mo](https://avatars.discourse-cdn.com/v4/letter/z/e79b87/32.png) [@zixu\_mo](https://forum.ansible.com/u/zixu_mo)\
**Post date:** [January 17, 2015, 12:29am UTC](https://forum.ansible.com/t/would-you-please-support-these-style-hosts-config/17299/7 "2015-01-17T00:29:35Z")

</div>

Is it right like this :

put one line into $HOME/.ansible.cfg

`

hostfile=$HOME/.ansible.hosts

``

`

```auto
.ansible.cfg

```

zixu mo於 2015年1月17日星期六 UTC+8上午8時15分25秒寫道：
