Windows 无法运行ansible playbook来运行bat文件
我正在尝试运行ansible playbook,以便在windows本地计算机上运行bat文件Windows 无法运行ansible playbook来运行bat文件,windows,powershell,ansible,Windows,Powershell,Ansible,我正在尝试运行ansible playbook,以便在windows本地计算机上运行bat文件 --- - hosts: localhost tasks: - name: Run command in cmd win_shell: sample.bat 但我收到错误-powershell:未找到。 请告诉我如何为ansible安装powershell解释器。请参阅有关使用cmd而不是powershell的文档/示例 # Run a com
---
- hosts: localhost
tasks:
- name: Run command in cmd
win_shell: sample.bat
但我收到错误-powershell:未找到。
请告诉我如何为ansible安装powershell解释器。请参阅有关使用cmd而不是powershell的文档/示例
# Run a command under a non-Powershell interpreter (cmd in this case)
- win_shell: C:\path\sample.bat
args:
executable: cmd
.ps1
通常是powershell扩展…我尝试使用win shell命令,但收到以下错误。“加载任务时遇到格式错误的块:{u'args':{u'executable':u'cmd'},u'win\u shell':u'C:\..\\sample.bat',u'register':u'homedir\u out'}应为列表或无,但“Iam只是在bat文件中运行vbs文件。”。bat文件是否有任何特定格式可遵循,错误来自Ansible而非批处理脚本。此块在您的任务范围内