Ansible templating.

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

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