What's wrong with doing it via inventory?

I suppose you could try explicitly setting 

hostvars.['localhost'].ansible_connection_method="local"

as a workaround.

Uditha.

On Tuesday, 22 March 2016 15:06:09 UTC, Yuri wrote:
>
> Hello,
>
> (Ansible version:2.0.0)
>
> I tried to execute the following playbook.
>
> -------
> - name: test
>   hosts: remote_windows_host
>   vars:
>     ansible_ssh_user: XXX
>     ansible_ssh_pass: XXX
>     ansible_ssh_port: XXXX
>     ansible_connection: winrm
>   tasks:
>     - name: setup(remote windows host)
>       setup:
>     - name: sleep(local linux host)
>       local_action: command sleep 5
> -------
>
> Then, the task "sleep(local linux host)" was failed.
> The results in debug mode is as follows.
>
> ----------
> TASK [sleep(local linux host)] 
> *************************************************
> task path: XXXXXXXXXXXXXXXXXXXXXXXXXX.yml:12
> <localhost> ESTABLISH WINRM CONNECTION FOR USER: XXX on PORT XXXX TO 
> localhost
> fatal: [XX.XX.XXX.XXX]: FAILED! => {"failed": true, "msg": "ERROR! ssl: 
> 500 WinRMTransport. Tunnel connection failed: 403 Forbidden"} 
> ----------
>
> Even though using local_action module, why does it try to connect to 
> localhost with winrm?
> How can I do so that LOCAL CONNECTION is used? (And not defining vars in 
> inventory file.)
>
>
> Thanks a lot for any help.
>
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b37f86d-1f79-48ad-a311-8a6ef1cdd35b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to