如果找不到脚本,我正在运行ansible来复制并执行远程端的脚本.但是我收到了这个错误.
错误!冲突的行动声明:复制,命令
如何在单个任务中使用多个动作.
---
- name: Check if the bb.sh exists
stat:
path: /tmp/bb.sh
register: stat_result
- name: Copy and execute script
copy: src=sync/bb.sh dest=/tmp/sync/ mode=0755
command: sh -c "/bin/sh /tmp/bb.sh"
when: stat_result.stat.exists == False
Run Code Online (Sandbox Code Playgroud) ansible ×1