Hi Eric There is a feature called Fact Caching which can facilitate this: http://docs.ansible.com/playbooks_variables.html#fact-caching
Regards Tom On 10 January 2015 at 17:06, Eric Feliksik <[email protected]> wrote: > I have an ansible role for machine X that uses use {{ > hostvars['Y']['network_address'] }} in a task. > > If I run 'ansible-playbook -i inventories/dev site.yml --limit="X"' > (Vagrant also runs it with --limit) this variable is not available. How can > I explicitly declare the dependency on the host Y in the ansible playbook, > such that ansible gathers facts (in this case, the ./host_vars/Y file) for > host Y? > > Thanks in advance, > Eric > > -- > 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/6dba276f-6585-44dd-a66c-c20b41ef7ab9%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/6dba276f-6585-44dd-a66c-c20b41ef7ab9%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/CAAnNz0NfqAqHRPDkDfUj85rKp0fzeuUb6b7YqFqy2%2BjMH5252Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
