TL;DR: zos_copy will always copy temporary files to /tmp/. If a user cannot read and write there, the module fails.
The module builds the temporary path (temp_path) with a call to gettempprefix(), which is built-in to the python tempfile library (python docs) and always returns 'tmp'.
Even when the ansible_remote_tmp (doc) variable is set in ansible.cfg, the module logic fails to check that configuration and builds the tempfile(s) under /tmp.
The module should honor the configuration set in the ansible_remote_tmp variable and build all temporary dirs/files at the configured location.
Find a way to set up temp_path so that the value of ansible_remote_tmp is honored instead of effectively hard-coding /tmp/... into temp_path.
Reported in IBM internal SLACK thread C0YPDHTGB/p1713974037809719.
IBM z/OS Ansible core Version
v1.8.0 (default)
IBM Z Open Automation Utilities
v1.2.5 (default)
IBM Enterprise Python
v3.12.x
ansible-version
v2.16.x (default)
z/OS version
v2.5 (default)
Ansible module
zos_copy
Playbook verbosity output.
See SLACK thread (verbosity dump may contain some internal IBM info)
Is there an existing issue for this?
Bug description
TL;DR:
zos_copy
will always copy temporary files to/tmp/
. If a user cannot read and write there, the module fails.The module builds the temporary path (
temp_path
) with a call togettempprefix()
, which is built-in to the pythontempfile
library (python docs) and always returns'tmp'
.Link to src
Even when the
ansible_remote_tmp
(doc) variable is set inansible.cfg
, the module logic fails to check that configuration and builds the tempfile(s) under/tmp
.The module should honor the configuration set in the
ansible_remote_tmp
variable and build all temporary dirs/files at the configured location.Find a way to set up
temp_path
so that the value ofansible_remote_tmp
is honored instead of effectively hard-coding/tmp/...
intotemp_path
.Reported in IBM internal SLACK thread
C0YPDHTGB/p1713974037809719
.IBM z/OS Ansible core Version
v1.8.0 (default)
IBM Z Open Automation Utilities
v1.2.5 (default)
IBM Enterprise Python
v3.12.x
ansible-version
v2.16.x (default)
z/OS version
v2.5 (default)
Ansible module
zos_copy
Playbook verbosity output.
See SLACK thread (verbosity dump may contain some internal IBM info)
Ansible configuration.
No response
Contents of the inventory
No response
Contents of
group_vars
orhost_vars
No response