linux Ansible“复制”模块失败|'in atomic_move os.rename(B_src,b_dest)OSError:[错误号0]错误'

dly7yett  于 2023-05-28  发布在  Linux
关注(0)|答案(1)|浏览(103)

接收错误

in atomic_move os.rename(b_src, b_dest) OSError: [Errno 0] Error

当我们试图将一个包从源复制到目的地时。当我们试图通过Ansible Tower部署软件包时,许多节点都发生了这种情况。
部分代码如下:

- name:  Copying war file to deployment hosts
  copy:
    src: "/data/war/{{war_file}}"
    dest: "/deployments/war/release/{{war_file}}"
    owner: user
    group: user
    mode: '0775'
  when:
    - 'ansible_hostname == dep_host_list'
  loop: "{{deployment_hosts}}"
  loop_control:
    loop_var: dep_host_list

塔作业的完整错误如下所示:

{
    "exception": "Traceback (most recent call last):\n  File \"/tmp/ansible_copy_payload_C9TqwM/ansible_copy_payload.zip/ansible/module_utils/basic.py\", line 2251, in atomic_move\n    os.rename(b_src, b_dest)\nOSError: [Errno 0] Error\n",
    "ansible_loop_var": "dep_host_list",
    "_ansible_item_label": "host",
    "checksum": "e55681eb4d74383e5b10121729f",
    "dep_host_list": "host",
    "msg": "Could not replace file: /home/user/.ansible/tmp/ansible-tmp-1677744165.38-29519-145869181884410/source to /deployments/war/release/war-1.0.war: [Errno 0] Error",
    "changed": false,
    "invocation": {
        "module_args": {
            "directory_mode": null,
            "force": true,
            "remote_src": null,
            "dest": "/deployments/war/release/war-1.0.war",
            "selevel": null,
            "_original_basename": "war-1.0.war",
            "delimiter": null,
            "regexp": null,
            "owner": "test_user",
            "follow": false,
            "validate": null,
            "local_follow": null,
            "src": "/home/user/.ansible/tmp/ansible-tmp-1677744165.38-29519-145869181884410/source",
            "group": "test_user",
            "unsafe_writes": null,
            "checksum": "e55681eb4d74383e5b10121729f",
            "seuser": null,
            "setype": null,
            "content": null,
            "serole": null,
            "mode": "0775",
            "attributes": null,
            "backup": false
        }
    },
    "diff": [],
    "_ansible_no_log": false
}

有人在通过Ansible Tower进行部署时遇到过类似的问题吗?
任何关于解决这个问题的建议都将非常感谢,因为我们完全被Ansible Tower卡住了,不允许在主机之间复制文件。

2ic8powd

2ic8powd1#

VMware Carbon Black Bit9安全解决方案阻止了Ansible的作业执行。我们已经设法通过从服务器禁用Bit9来修复它。

相关问题