![ansible.posix.synchronize 因未知的 rsync 选项而失败](https://linux22.com/image/779335/ansible.posix.synchronize%20%E5%9B%A0%E6%9C%AA%E7%9F%A5%E7%9A%84%20rsync%20%E9%80%89%E9%A1%B9%E8%80%8C%E5%A4%B1%E8%B4%A5.png)
我正在运行 ansible 剧本,其任务如下:
- name: Yada Yada Yada
ansible.posix.synchronize:
src: ../foo/bar/
dest: /home/tada/tokio
当我使用 AWX 运行它时,出现以下错误(请参阅此问题底部的原始 json 格式):
rsync: on remote machine: --sparse-block=1024: unknown option
rsync error: syntax or usage error (code 1) at main.c(1749) [server=3.2.3]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]
有关版本的信息:
- AWX: quay.io/ansible/awx:21.3
- 远程目标主机:Ubuntu 22.04
- 远程主机上的 rsynch:版本 3.2.3 协议版本 31(我也尝试过使用 Ubuntu 20.04,运行的是 3.1.3)
- 自定义执行器(使用 ansible-builder 构建)
- 执行器中的 rsync:3.1.3 协议版本 31
从本地机器运行时它可以正常工作,但从 AWX 运行时它会失败。
AWX 报告的完整错误
{
"rc": 12,
"cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --out-format='<<CHANGED>>%i %n%L' /runner/project/foo/bar/ [email protected]:/home/tada/tokio",
"msg": "Warning: Permanently added 'xx.xx.xx.xx' (ECDSA) to the list of known hosts.\r\nrsync: on remote machine: --sparse-block=1024: unknown option\nrsync error: syntax or usage error (code 1) at main.c(1749) [server=3.2.3]\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]\n",
"invocation": {
"module_args": {
"src": "/runner/project/foo/bar/",
"dest": "[email protected]:/home/tada/tokio",
"_local_rsync_path": "rsync",
"_local_rsync_password": null,
"private_key": null,
"rsync_path": null,
"delete": false,
"_substitute_controller": false,
"archive": true,
"checksum": false,
"compress": true,
"existing_only": false,
"dirs": false,
"copy_links": false,
"set_remote_user": true,
"rsync_timeout": 0,
"rsync_opts": [],
"ssh_connection_multiplexing": false,
"partial": false,
"verify_host": false,
"delay_updates": true,
"mode": "push",
"dest_port": null,
"recursive": null,
"links": null,
"perms": null,
"times": null,
"owner": null,
"group": null,
"ssh_args": null,
"link_dest": null
}
},
"_ansible_no_log": false,
"changed": false
}