好的。。我走了。这是我的 main.yml 内容。
- hosts: web-servers
tasks:
- name: Run the below script
command: sh temp/myscript.sh
Run Code Online (Sandbox Code Playgroud)
我有一个名为“myscript.sh”的 shell 脚本放在名为“temp”的目录下。我的目录层次结构是:
我不想将 shell 脚本复制到我的主机服务器并从 thre 运行。我想运行与 main.yml 文件一起可用的 shell 脚本。
当我运行这个剧本时,我得到一个错误,如:stderr: sh: temp/myscript.sh: No such file or directory
请帮忙解决这个问题。