0

I have a playbook that gathers facts, and then stores the facts in a variable. I then copy the contents of that variable to a file on a delegated node.

If I run this playbook natively, it works perfectly. However if I run this in AWX is fails with a permissions error about could not replace a file... I've replaced the hostnames with HOSTNAMEFQDN

{
    "diff": [],
    "exception": "Traceback (most recent call last):\n  File \"/tmp/ansible_ansible.legacy.copy_payload_0tkpo2kb/ansible_ansible.legacy.copy_payload.zip/ansible/module_utils/basic.py\", line 1692, in atomic_move\n    os.rename(b_src, b_dest)\nFileNotFoundError: [Errno 2] No such file or directory: b'/home/awx_logging/.ansible/tmp/ansible-tmp-1689860300.7143111-3127874-276636874784430/source' -> b'/ansible-facts/HOSTNAMEFQDN'\n",
    "msg": "Could not replace file: b'/home/awx_logging/.ansible/tmp/ansible-tmp-1689860300.7143111-3127874-276636874784430/source' to /ansible-facts/HOSTNAMEFQDN: [Errno 2] No such file or directory: b'/home/awx_logging/.ansible/tmp/ansible-tmp-1689860300.7143111-3127874-276636874784430/source' -> b'/ansible-facts/HOSTNAMEFQDN'",
    "invocation": {
        "module_args": {
            "dest": "/ansible-facts/HOSTNAMEFQDN",
            "force": true,
            "src": "/home/awx_logging/.ansible/tmp/ansible-tmp-1689860300.7143111-3127874-276636874784430/source",
            "_original_basename": "tmpgph1dbgo",
            "follow": false,
            "checksum": "10461ad073e1319ba70937353f7fd3738bad2751",
            "backup": false,
            "unsafe_writes": false,
            "content": null,
            "validate": null,
            "directory_mode": null,
            "remote_src": null,
            "local_follow": null,
            "mode": null,
            "owner": null,
            "group": null,
            "seuser": null,
            "serole": null,
            "selevel": null,
            "setype": null,
            "attributes": null
        }
    },
    "checksum": "10461ad073e1319ba70937353f7fd3738bad2751",
    "_ansible_no_log": null,
    "changed": false,
    "_ansible_delegated_vars": {
        "ansible_host": "ANSIBLEHOST",
        "ansible_port": null,
        "ansible_user": "AWXUSER",
        "ansible_connection": "ssh"
    }
}

If I enable the option in AWX to not delete temporary files and do the same thing its do, as the AWXUSER its also successful.

Has anyone got any other ideas I can use to debug this issue?

Zeitounator
  • 38,476
  • 7
  • 53
  • 66

0 Answers0