Hi Eric,
You can describe the inventory on the commandline (look on the trailing
comma in the inventory-option ;-D):
ansible-playbook -i"X,Y," site.yml
then inside your playbook have one "hosts: all" only for fact gathering and
another for "hosts: X" for the tasks to run on host X.
Cheers
Ulli
Am Samstag, 10. Januar 2015 16:06:57 UTC+1 schrieb Eric Feliksik:
>
> 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/67c2c9a2-e9cf-45e9-8aa3-43ff87a576c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.