Using inventory shortcut -i "host," on ansible 1.5

66 views
Skip to first unread message

Dmitry Horbach

unread,
Mar 4, 2014, 10:30:04 AM3/4/14
to ansible...@googlegroups.com
Hi,

I guess it has something to do with new localhost feature of ansible 1.5

In playbook with
 hosts: localhost:host

if i specify -i "host," the play will be done for both localhost and host

GATHERING FACTS ***************************************************************
ok: [localhost]
ok: [oracle] 

Is there any workaround for this situation? 

Michael DeHaan

unread,
Mar 4, 2014, 10:33:12 AM3/4/14
to ansible...@googlegroups.com
So in Ansible now, localhost is implicitly added to inventory.   This means you can reference it and it will work.

Now "-i host," is an ugly vestigial tail of Ansible, and I swear I want to cut it off, but I'm not willing to deal with the people that have come to rely on it being angry :)

We strongly encourage making inventory files and people should make inventory files.

That being said, what you have above works exactly the same as if you did 

[foo]
host

and did the same with regular Ansible, that was just my PSA about the evils of "-i host," and this not being specific to that :)

So yes, this works exactly as it should.   

You should defintely move to using inventory files, but "--limit hosts" should not include localhost in the above case.







--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/24d03a2c-f50b-4e5f-ac24-e989f4116b7a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages