Inventory file and hosts: localhost

31 views
Skip to first unread message

Wood Peter

unread,
Feb 22, 2016, 11:02:27 PM2/22/16
to ansible...@googlegroups.com
Hi,

I'm using ansible-1.9.4 (from CentOS7 distro) and also I'm new to the product.

I'm trying to come up with some form of bootstrapping after kickstart where ansible-pull will run a few tasks regardless of the hostname.

Seems that 'hosts: localhost' should do the right thing but I'm running in the following issues:

- If the hosts file has no entry for the new system
  The ansible-pull will fail.

- If the hosts file is empty
  The ansible-pull will properly process 'hosts: localhost" play.

- If the hosts file doesn't exists
  The ansible-pull will fail.

The only way to make "hosts: localhost" work is to empty the hosts file.

Is that the expected behavior or I'm missing some configuration?

Thank you,

-- Peter

Peter W

unread,
Feb 22, 2016, 11:02:29 PM2/22/16
to Ansible Project
Reply all
Reply to author
Forward
0 new messages