Dynamically alter remote_tmp

1,117 views
Skip to first unread message

chris scott

unread,
Mar 18, 2016, 11:10:03 AM3/18/16
to Ansible Project
I have a simple problem. I'm pushing up a tarball with the unarchive module, and the dest setting is pointing to a large volume. However it unarchive module pushes the file to the remote_tmp dir 1st. This is on /home be default, however /home isnt big enough to take the tarball  on the system machine image. The copy module also has the same problem. Altering the remote_tmp variable in the .cfg file is easy enough, however this then affects everything on the ansible system, and will break other things. Therefore I need to be able to set this variable on the fly in the role, or worst case the play. However all my attempts seem to get ignored.

I have tried the following on the cli

chris scott

unread,
Mar 18, 2016, 11:12:12 AM3/18/16
to Ansible Project
-e "ANSIBLE_REMOTE_TEMP=/cedar/"
 and
-e "remote_tmp=/cedar/"

ive also done the following in the play and the role

    environment:
      remote_tmp=/cedar/.tmp
      ANSIBLE_REMOTE_TEMP=/cedar/.tmp

Both modules still write to ~/.ansible/tmp as their tmp dir though

Brian Coca

unread,
Mar 18, 2016, 11:58:22 AM3/18/16
to ansible...@googlegroups.com
remote_tmp is set in ansible.cfg and ANSIBLE_REMOTE_TEMP should be a env var BEFORE ansible runs not inside Ansible:

 ANSIBLE_REMOTE_TEMP=/cedar/.tmp ansible-playbook play.yml ....

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dac0cbf7-66ce-407b-9b44-426386a96c77%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages