Ansible-play reference a local hosts file

26 views
Skip to first unread message

Eric Marquez

unread,
Jul 10, 2016, 2:22:43 PM7/10/16
to ansible...@googlegroups.com

How do I get Ansible-play to reference a local hosts files?  I created a hosts file in the same directly with my site.yaml file but it doesn’t seem to reference it.  Is there a way to get it to use a local vs the /etc/Ansible/hosts?

I would like to have a local version and not need to update the master with a priv account.

 

Thanks in advance.

Kai Stian Olstad

unread,
Jul 10, 2016, 2:36:11 PM7/10/16
to ansible...@googlegroups.com
On 10. juli 2016 20:22, Eric Marquez wrote:
> How do I get Ansible-play to reference a local hosts files? I created a hosts file in the same directly with my site.yaml file but it doesn't seem to reference it. Is there a way to get it to use a local vs the /etc/Ansible/hosts?
> I would like to have a local version and not need to update the master with a priv account.

In the same directory as your site.yaml and host file, create a
ansible.cfg file with the following content:

[defaults]
hostfile = <name of your hostfile>


--
Kai Stian Olstad

Eric Marquez

unread,
Jul 10, 2016, 2:41:09 PM7/10/16
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages