# Ansible templating.

**URL:** <https://forum.ansible.com/t/ansible-templating/21658>\
**Category:** Ansible Project\
**Created:** [June 3, 2016, 2:00pm UTC](https://forum.ansible.com/t/ansible-templating/21658 "2016-06-03T14:00:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Morgan](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@Jason\_Morgan](https://forum.ansible.com/u/Jason_Morgan)\
**Post date:** [June 3, 2016, 2:00pm UTC](https://forum.ansible.com/t/ansible-templating/21658/1 "2016-06-03T14:00:31Z")

</div>

Hi I am writing an Ansible playbook for a specific piece of software. I would be interested in hearing experience/recommendations/best practice of how to deal with managinf config files between software versions where parameters are deprecated and new parameters are introduced. Shoud I be looking at a template for each software version or a single config file with if version == statements.

Thanks

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [June 3, 2016, 4:41pm UTC](https://forum.ansible.com/t/ansible-templating/21658/2 "2016-06-03T16:41:23Z")

</div>

That depends. Or to put it differently: Whatever suits you best.

Debian and CentOS have different versions of the fail2ban package,  
where the complete configuration is different. So, I got two different  
templates depending on the version.

OpenSSH has a similar config on all systems, with small deviations (no  
UsePAM on OpenBSD, path to sftp-server, ...). There I have one file  
with many '{% if ansible\_os\_family == "XYZ" %}' blocks.

Johannes
