I want to fix the following warning by manually creating the path:
Wednesday 22 January 2020 12:50:41 +0100 (0:00:05.878) 0:20:16.431 *****
[WARNING]: Module remote_tmp /home/db2inst1/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the remote_tmp dir with the correct permissions
manually
To keep things DRY, I don't want to just use the pattern in a file
directive for creation. Instead, I'd like to access the remote_tmp
variable inside my playbook to dynamically fetch the path, even when it's changed by environment variables or the ansible.cfg
file.
I couldn't find a documentation about this variable and tried:
- debug:
#var: remote_tmp
#var: hostvars[remote_tmp]
var: ansible_remote_tmp
but always got an error that the variable is not defined.
How can I get the remote_tmp
variable from the config inside a playbook?