Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is possible to define ansible_tmp variable in playbook?

Tags:

ansible

I want to copy large files using ansible. Destination servers have a dedicated partition with adequate storage space. I noticed that ansible uses its temporary directory which defined by remote_tmp variable.

I would to copy directly files in the dedicated partition without passing by temporary directory.

Is it possible to define remote_tmp variable in playbook for this case ? I'm running ansible 1.8.

Thanks for your answers.

like image 947
Sprink Avatar asked Dec 25 '22 01:12

Sprink


1 Answers

You can change remote_tmp in the Ansible configuration.
Ansible uses a configuration tree that looks first in the working dir, so you can place an ansible.cfg file alongside the playbook that changes only this value and it won't affect playbooks in other directories.

But I'd recommend to use synchronize_module if you need advanced options for copying files.

like image 114
Konstantin Suvorov Avatar answered Jan 12 '23 04:01

Konstantin Suvorov