我正在将Linux ansible脚本转换为Windows。有一个名为“脚本”的模块可用,该模块正在向远程目标计算机运行本地脚本。 但是没有等效的win_script模块存在。 当我使用win_shell模块时,它期望文件位于远程计算机中。
- name: Create a filesystem and perform IO operation using powershell script
win_shell: "{{pshfile}} {{disc_ip}} {{storage_array_vol}} {{file1}}"
是否可以通过ansible将本地Powershell脚本运行到远程计算机中?
答案 0 :(得分:1)
首先将脚本复制到目标节点,然后执行它。 https://docs.ansible.com/ansible/latest/modules/win_copy_module.html