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

49 views
Skip to first unread message

tntda...@gmail.com

unread,
Oct 1, 2020, 8:56:18 AM10/1/20
to Ansible Development
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

John Westcott

unread,
Oct 1, 2020, 9:08:25 AM10/1/20
to tntda...@gmail.com, Ansible Development
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



--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/8ddf7624-abc3-4939-8248-5ccd103ba175n%40googlegroups.com.

tntda...@gmail.com

unread,
Oct 1, 2020, 9:23:57 AM10/1/20
to Ansible Development
Many thanks John. That is great to know. Always learning something new :) 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

Reply all
Reply to author
Forward
0 new messages