我正在尝试一个简单的任务,找出两个文件之间的差异,并将其存储在记事本中.我不能用命令和shell来做.请说明我错在哪里 -
---
- hosts: myserver
tasks:
- name: get the difference
command: diff hosts.new hosts.mod
register: diff
- debug: var=diff.cmd
Run Code Online (Sandbox Code Playgroud)
错误 -
fatal: [zlp12037]: FAILED! => {"changed": true, "cmd": ["diff", "hosts.new", "hosts.mod"], "delta": "0:00:00.003102", "end": "2017-03-29 10:17:34.448063", "failed": true, "rc": 1, "start": "2017-03-29 10:17:34.444961", "stderr": "", "stdout":
Run Code Online (Sandbox Code Playgroud) ansible ×1