Ansible Tower Copy Module can't find file on Ansible Controller

Hi all,

Hoping to get some feedback and help here as I am lost on this one…

Issue:
When running the below code through Tower:

  • name: “Copy cert file to target host”
    become: yes
    copy:
    src: “/tmp/my.jks”
    dest: “{{ mule_home }}/certs/”
    owner: serviceaccountuser
    group: serviceaccountgroup

I get the following error:
“msg”: “Could not find or access ‘/tmp/apiint_medica_com.jks’ on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option”

When I run the same task on the same tower execution node via the CLI it works no problem.

I’ve tried using delegate_to as well to ensure force find of the file on the specific node in question and still no luck.

I also used the find module, and the find module can find the file with no problems.

I am at a loss of what the problem here his when the same code works on the CLI but fails when ran through Tower.

Any thoughts?

Thanks!
Tom

Tower runs Ansible through bubble wrap which is like a chroot jail.
The /tmp available in the bubble wrap environment may not be the same /tmp on the actual Tower server.
If you need a directory exposed to the bubble wrap container look in settings => jobs => path to expose to isolated jobs.

-John

Many thanks John. That is great to know. Always learning something new :slight_smile: I changed the path of the download from /tmp to /opt and it worked like a charm. Will keep the paths to expose in mind for the future!

Tom