Reputation: 398
Since my company needs time to consider security issues with WinRM which is used by Ansible to manage windows hosts I was thinking about doing it via Cygwin ssh connection which we already have installed. Is this even possible? I tried to setup env variables like that:
ansible_connection: ssh
ansible_shell_type: cmd
End I'm trying to create a folder with the folliwng playbook:
- name: Ensure C:\Temp exists
win_file:
path: C:\Temp
state: directory
Gathering Facts is succesfull, but I'm getting: FAILED! => {"changed": false, "msg": "Unhandled exception while executing module: The system cannot find the path specified"}
Upvotes: 1
Views: 1692
Reputation: 738
In theory, Ansible, since v.2.8, supports doing connections through SSH, new windows even come with a Microsoft fork of OpenSSH. I am having trouble to make it work (that's how I ended up here), but I recommend you to take a look to the following links:
If you can do SSH using the PK, but you get an unreachable from Ansible, you may need to check also this:
For Windows Server 2019/10's OpenSSH configuration:
Upvotes: 1