ansible.posix.synchronize 因未知的 rsync 选项而失败

ansible.posix.synchronize 因未知的 rsync 选项而失败

我正在运行 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
}

相关内容