Maybe you've wondered why I don't just set everything to local. My playbook 
contains other tasks to pull facts from a Windows machine. That's why I 
have the connection configured for winrm. Then I want to retrieve those 
facts into a .csv file created locally, which is what is failing.

Update: 

I have used delegate_to: localhost too, without success.

I added this to the playbook expecting to connect to my pc:
- name: change connection 
add_host:
hostname: name
ansible_user: myuser
ansible_password: mypassphrase
ansible_port: 22
ansible_connection: ssh
changed_when: true

Seems it doesn't actually change the connection
TASK [change connection] 
*******************************************************************************************
changed: [10.240.30.249]

TASK [execute locally] 
*******************************************************************************************
 [WARNING]: No python interpreters found for host 10.240.30.249 (tried 
['/usr/bin/python', 'python3.7',
'python3.6', 'python3.5', 'python2.7', 'python2.6', 
'/usr/libexec/platform-python', '/usr/bin/python3',
'python'])

fatal: [10.240.30.249]: FAILED! => {"ansible_facts": 
{"discovered_interpreter_python":... and so on.




On Wednesday, 31 July 2019 16:34:02 UTC-5, Gabriel Rios wrote:
>
> Hi,
>
> I'm currently experiencing a problem when executing the following 
> playbook. Everything I'm currently executing is attached too. What should I 
> modify? 
>
> ---
> - hosts: all
> vars_files:
> - winrms.yml
> tasks:
> - name: execute locally
> local_action:
> module: file
> path: /home/gabriel/Conex_ansible/reporte.csv
> state: touch
>
> It gives the error
> fatal: [10.240.30.249]: UNREACHABLE! => {"changed": false, "msg": "ssl: 
> HTTPSConnectionPool(host='localhost', port=5986): 
> Max retries exceeded with url: /wsman (Caused by 
> NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object 
> at 0x7fd25dd28590>: Failed to establish a new connection: [Errno 111] 
> Connection refused',))", "unreachable": true} 
>
> I am currently connected to a Windows server, inventory.ini only contains 
> the IP address of said server and winrms.yml contains:
> ---
> ansible_user: user
> ansible_password: password
> ansible_port: 5986
> ansible_connection: winrm
> ansible_winrm_server_cert_validation: ignore
>
>
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8bd27a92-1931-42ad-bb83-98d9dd44543d%40googlegroups.com.

Reply via email to