I need to run a command that needs to consume a file for its configuration. What would be the best practice for cases like this where a temporary file needs to be copied remotely and then deleted after a certain task has executed.
Is copying these files to Ansible’s remote_tmp a recommended practice? If so, how can that be achieved (I tried using {{ remote_tmp }} in my task but it didn’t seem to work), and will the file be cleaned up automatically once the playbook finishes running?
Thanks in advance for any input regarding this question.
–Pedro.