Ansible templating.

21 views
Skip to first unread message

Jason Morgan

unread,
Jun 3, 2016, 10:00:31 AM6/3/16
to Ansible Project
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

Johannes Kastl

unread,
Jun 3, 2016, 12:41:46 PM6/3/16
to ansible...@googlegroups.com
On 03.06.16 16:00 'Jason Morgan' via Ansible Project wrote:

> Shoud I be looking at a template for each software version or a
> single config file with if version == statements.

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

signature.asc
Reply all
Reply to author
Forward
0 new messages