如何在 windows 台主机上使用 Cygwin 配置 Ansible
How to configure Ansible with Cygwin on windows hosts
由于我的公司需要时间考虑 Ansible 用来管理 windows 主机的 WinRM 的安全问题,所以我正在考虑通过我们已经安装的 Cygwin ssh 连接来实现。
这可能吗?
我尝试像这样设置环境变量:
ansible_connection: ssh
ansible_shell_type: cmd
结束 我正在尝试使用以下剧本创建一个文件夹:
- name: Ensure C:\Temp exists
win_file:
path: C:\Temp
state: directory
收集事实成功,但我得到:失败! => {"changed":错误,"msg":"Unhandled exception while executing module: The system cannot find the path specified"}
从理论上讲,Ansible 从 v.2.8 开始支持通过 SSH 进行连接,新 windows 甚至附带了 OpenSSH 的 Microsoft 分支。
我无法使其正常工作(这就是我在这里结束的原因),但我建议您查看以下链接:
如果您可以使用 PK 执行 SSH,但无法从 Ansible 访问,您可能还需要检查以下内容:
对于 Windows Server 2019/10 的 OpenSSH 配置:
Setting up OpenSSH for Windows using public key authentication
由于我的公司需要时间考虑 Ansible 用来管理 windows 主机的 WinRM 的安全问题,所以我正在考虑通过我们已经安装的 Cygwin ssh 连接来实现。 这可能吗? 我尝试像这样设置环境变量:
ansible_connection: ssh
ansible_shell_type: cmd
结束 我正在尝试使用以下剧本创建一个文件夹:
- name: Ensure C:\Temp exists
win_file:
path: C:\Temp
state: directory
收集事实成功,但我得到:失败! => {"changed":错误,"msg":"Unhandled exception while executing module: The system cannot find the path specified"}
从理论上讲,Ansible 从 v.2.8 开始支持通过 SSH 进行连接,新 windows 甚至附带了 OpenSSH 的 Microsoft 分支。 我无法使其正常工作(这就是我在这里结束的原因),但我建议您查看以下链接:
如果您可以使用 PK 执行 SSH,但无法从 Ansible 访问,您可能还需要检查以下内容:
对于 Windows Server 2019/10 的 OpenSSH 配置:
Setting up OpenSSH for Windows using public key authentication