# backup location in template module

**URL:** <https://forum.ansible.com/t/backup-location-in-template-module/18227>\
**Category:** Ansible Project\
**Created:** [May 14, 2015, 2:57am UTC](https://forum.ansible.com/t/backup-location-in-template-module/18227 "2015-05-14T02:57:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikas\_Kumar](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Vikas\_Kumar](https://forum.ansible.com/u/Vikas_Kumar)\
**Post date:** [May 14, 2015, 2:57am UTC](https://forum.ansible.com/t/backup-location-in-template-module/18227/1 "2015-05-14T02:57:25Z")

</div>

Dear All,

I have below line from my ansible playbook which uses [template](http://docs.ansible.com/template_module.html) module.

`

- template: src=nginx\_conf.j2 dest=/etc/nginx/nginx.conf backup=yes  
`

This works great, but create a backup in the same directory (/etc/nginx/ in this case). Is there a way out to somehow create the backup on a different location, say /etc/nginx/backups/ directory.

Regards,  
Vikas

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 14, 2015, 3:53am UTC](https://forum.ansible.com/t/backup-location-in-template-module/18227/2 "2015-05-14T03:53:32Z")

</div>

not yet, a couple of features we have been considering a)configurable  
'backup depo' on target machine (/var/cache/ansible/backups) and/or  
backup up on 'master'.

---

<div class="post-metadata">

**Author:** ![Vikas\_Kumar](https://avatars.discourse-cdn.com/v4/letter/v/ecb155/32.png) [@Vikas\_Kumar](https://forum.ansible.com/u/Vikas_Kumar)\
**Post date:** [May 14, 2015, 4:19am UTC](https://forum.ansible.com/t/backup-location-in-template-module/18227/3 "2015-05-14T04:19:33Z")

</div>

Thank you Brian. I would look forward to have this feature.

Regards,  
Vikas

---

<div class="post-metadata">

**Author:** ![joel1](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@joel1](https://forum.ansible.com/u/joel1)\
**Post date:** [February 19, 2016, 4:11am UTC](https://forum.ansible.com/t/backup-location-in-template-module/18227/4 "2016-02-19T04:11:24Z")

</div>

Hi,

Any update on this?

Is there a workaround to achieve this? Maybe with a callback plugin?

Thanks!

Best regards,  
Joel.
