I think the issue is Ansible doesn't gather facts from hosts that
aren't in the play.
We have a central log/graphite server that all hosts wired their
monitoring agents into,
and in our case just using an inventory hostname wasn't enough since
traffic needed to
flow over a dedicated instrumentation network, so we'd have to figure
out the IP of the
interface connected to that subnet.
This was a pretty big stack so when you changed something on a
specific group of servers,
a quick 'limit run' saved a few minutes and we constantly forgot to
add the monitoring
servers into the limit list.
Best workaround I found was to limit the amount of hostvars I used and
replace them with
inventory variables. These were physical servers so keeping specific
data in the inventory
was practical, that may be more difficult on e.g. AWS.
Another way would be to break your main playbook into smaller
sub-playbooks and explicitly
gather the required facts at the top of them.
On 25 September 2015 at 20:04, Anubhav Gupta
> --
> 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/70581c57-2b68-404b-b60e-a0a27ad1d92c%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.