1.在使用ansible中使用synchronize模块,抛出错误。

192.168.56.100 | FAILED! => {
"changed": false,
"cmd": "/bin/rsync --delay-updates -F --compress --archive --rsh=/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --out-format=<<CHANGED>>%i %n%L 192.168.56.100:/tmp/log/*_linuxHealthCheck_211029.log /home/sysinsp/logs",
"msg": "Warning: Permanently added '192.168.56.100' (ECDSA) to the list of known hosts./r/nbash: rsync: command not found/nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]/nrsync error: remote command not found (code 127) at io.c(226) [Receiver=3.1.2]/n",
"rc": 127
}

2.原因是因为系统中没有rsync命令,系统还有一些其他命令,索性就一起安装了。

yum install sysstat rsync bc -y

版权声明:本文为博主原创文章,未经博主允许不得转载。

linux