ansible - 如何使用ansible将文件从linux发送到windows服务器?
问题描述
我正在尝试将文件从 Linux 主机发送到我的 Windows 服务器。但是,我似乎无法让我的代码正常工作。我查看了文档,发现我必须使用该win_copy
模块。虽然当我使用它时,什么都没有发生并且它失败了。我不确定我是在目标类别还是清单类别中指定主机。
代码:
- name: Copy file to windows server
win_copy:
src: /home/robert
dest: user@wvrp00002aa2.domain.name.com:C:\Users\username\Desktop
错误:
TASK [Copy files in windows systems] *******************************************************************************************************************************************************************
fatal: [11.110.60.000]: FAILED! => {"changed": false, "checksum": "euifnbf74895845ndej8dh733hd74gf7", "dest": "C:\\Users\\robert\\dev", "module_stderr": "Shared connection to 11.110.60.000 closed.\r\n", "module_stdout": "/bin/sh: powershell: command not found\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "operation": "file_copy", "original_basename": "text.txt", "rc": 127, "size": 20, "src": "/home/robert/text.txt"}
解决方案
正确的缩进会有帮助吗?
- name: Copy file to windows server
win_copy:
src: /home/robert
dest: user@wvrp00002aa2.domain.name.com:C:\Users\username\Desktop
推荐阅读
- javascript - 未从不同的 js 文件定义的函数(不是顺序问题) - 仅限 IE
- python - multiprocessing.Queue 的高性能替代品
- python - 在 Node.js 中作为子进程运行时 Python 版本错误?
- fpga - 在 SPI 模式下使用 SD 卡时,您可以在块读取过程中取消断言 CS 吗?
- reactjs - 如何使用 Jest 模拟/测试按键?
- java - Map.entry(...) 未定义 Map 类型
- javascript - 反应渲染标签
- jenkins - 我应该使用构建用户还是 jenkins 用户来构建项目?即谁应该拥有詹金斯的构建工件?
- r - 如何使用 lubridate 将日期到日期时间转换为自 R 中的 UNIX 纪元以来的秒数?
- ios - 如何在 Xcode 中设置 UITableView 部分的标题渐变(和透明)背景?