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.