On 06. juli 2017 11:49, Rasmus Sjørslev wrote:
how (if possible) can i run a task using eg. win_shell against a specific
host that takes a variable from the overall playbook it is being
initialised from?

I have tried an

- include: dns_changes.yml
   hosts: windows_server
   vars:
     ip: "{{ my_ip }}"

as a playbook include but that wont work as i think im breaking the
variable scope ? I get an undefined fatal.

i have also played around with something like:

- include: dns_changes.yml hosts=windows_server

as a task include but that does not seem to work.

use delegate_to, that will run the task(s) on the delegated host.

--
Kai Stian Olstad

--
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/73642b2c-b159-e2bf-3f8f-f9f384a7ab25%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to