Unable to copy file at remote location through awx

ISSUE TYPE

FIle is not copying to remote location

Any help will be much appreciated.

I tried ping module for the same host and it is working fine.

SUMMARY

I am trying to copy a file to a remote host. However, it seems awx is looking for it in temporary directory which it creates during the processing. I am pulling the playbook from Git.

awx 10

python 3.6
ansible 2.9
linux 7.6- name: copy file
hosts: all
tasks:

  • name: Copy file
    copy:
    src: /tmp/testcopy.txt
    dest: /home/rishabh

That is a feature, not an issue. You can disable job isolation in the settings, but it would be more secure to modify the playbook so it doesn’t need to break the isolation.

rishabh gupta (rishabhgupta1608@gmail.com) said:

ISSUE TYPE

FIle is not copying to remote location

Any help will be much appreciated.

I tried ping module for the same host and it is working fine.
SUMMARY

I am trying to copy a file to a remote host. However, it seems awx is
looking for it in temporary directory which it creates during the
processing.

Playbooks are isolated from each other, each has their own /tmp.

I'd suggest putting the file you're copying in the source control, or
on some other file server/storage with a well known path, rather than trying
to stage it in /tmp.

Bill

https://docs.ansible.com/ansible/latest/modules/copy_module.html

The ansible copy command goes through the standard directory checks. Generally i put the file in the /files directory and it works without a problem. Where is the file located you are trying to copy?

If it is on the remote source you can use the remote_src option.

If it is a URL then you will need to use the get URL option https://docs.ansible.com/ansible/latest/modules/get_url_module.html