implicit localhost and limit

114 views
Skip to first unread message

Jesse Keating

unread,
May 1, 2014, 3:36:25 PM5/1/14
to ansible...@googlegroups.com
So with 1.5 there is an implicit localhost, which means we don't have to
have an explicit one in our inventory to do things like

hosts: localhost
or
local_action: foo
or
delegate_to: localhost


This is great, and awesome, and works fine, however I'm curious what the
semantics are when --limit comes into play.

What happens when you encounter a play that has hosts: localhost , and
your --limit does not include localhost? Should it run?

What about delegate_to: localhost when your limit doesn't include
localhost?

Taking a thought stab, I would expect that plays with hosts: localhost
would skip with no matching host, but the delegation would work, because
it would be operating in the host loop for a host you've included in
your limit, even if the task is delegated out. This is how it would work
with any other host.

Is my thinking correct here?

-jlk

Michael DeHaan

unread,
May 1, 2014, 5:38:19 PM5/1/14
to ansible...@googlegroups.com
So right now it's pretty explicit, I believe, and if you say "don't include localhost" it doesn't.

Thus localhost isn't implicit in the limit.

I can see it both ways.

In this case, I think I'd side on requiring limit to explicitly include localhost to avoid accidental self management in cases where a configuration might apply to many machines and somebody (against the norm) was running ansible on a machine that also expected to be managing that machine.

Thoughts?

I do think delegation should continue to work fine, as delegation has always worked outside of limits.






--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5362A239.2010403%40j2solutions.net.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages