# restoring old configuation

**URL:** <https://forum.ansible.com/t/restoring-old-configuation/25814>\
**Category:** Ansible Project\
**Created:** [October 25, 2017, 5:06am UTC](https://forum.ansible.com/t/restoring-old-configuation/25814 "2017-10-25T05:06:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![id.ssh.2017](https://avatars.discourse-cdn.com/v4/letter/i/df705f/32.png) [@id.ssh.2017](https://forum.ansible.com/u/id.ssh.2017)\
**Post date:** [October 25, 2017, 5:06am UTC](https://forum.ansible.com/t/restoring-old-configuation/25814/1 "2017-10-25T05:06:50Z")

</div>

Team,  
I want to write a playbook where we need to check the samba configuration file and if someone has made any changes accidentally it should restore the old config file.

Thanks,

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 25, 2017, 7:14am UTC](https://forum.ansible.com/t/restoring-old-configuation/25814/2 "2017-10-25T07:14:02Z")

</div>

Thats the default function of Ansible.

To create this file you have two choices, the copy module[1] or the template module[2].  
Copy module just copies a static file out and with template you can have a dynamic file based on facts from the host.

[1] [http://docs.ansible.com/ansible/latest/copy\_module.html](http://docs.ansible.com/ansible/latest/copy_module.html)  
[2] [http://docs.ansible.com/ansible/latest/template\_module.html](http://docs.ansible.com/ansible/latest/template_module.html)
