You cannot force fact gathering on other hosts not in the limit group when
using --limit.

The solution is to not use limit and do something like:

- hosts: all
  gather_facts: True
  tasks: []

- hosts: "somegroup{{optional_limit|default('')}}"
   tasks:
      -

And run ansible-playbook sometimes with

ansible-playbook foo.yml -e "optional_limit=&boston"

If you need the behavior.

I agree that's gross.

What we really need to do is be able to allow "--limit" to control the
default limit, and at play level allow a "limit: all" to be passed in
(which should be the default).

Pull requests to this effect, if sufficiently clean would be entertained.

I think that's nicer than having to do go through those hoops above.


On Fri, Jul 18, 2014 at 3:25 AM, Nico K. <[email protected]> wrote:

> Hi,
>
> I've been reading through a lot of posts regarding the subject of "fact
> gathering" and I'm under the impression that it's impossible to force fact
> gathering on hosts when using '--limit'?
> My specific use case would be obtaining IP addresses of all hosts to
> populate the firewall ruleset with.
>
> Ideally I would like to force gathering the facts on a couple of the
> groups I have defined no matter what the '--limit' is set to.
>
> For the time being, is there a work around? Is there an easy way to
> resolve a DNS entry?
>
> Thanks,
> Nico
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/401633e4-5c78-45a4-af73-86b1a97dd3ca%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/401633e4-5c78-45a4-af73-86b1a97dd3ca%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw5ieZ8TRo4vCn7-MOo%2B2Y9ZENgAVKYNes04z_8PsitBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to