configuration file versioning

one of the uses I have for ansible is to deploy our app to the production servers
we are currently using deb packages for the delivery

the app also has a set of conf files that need to be copied over which are not part of the deb for the app itself
so we have app-1.0.deb for the app and conf-3.2.deb for the config files

theat approach for the confs is not very optimal as I have a bunch of them and that leads to too much packaging and distribution anyway and I also need to have several copies of the config file with slight differences in other locations

the requirement is to be able to look at the server at a given moment be able to know what is installed/configured

I am looking into replacing that model with simply a git repo and the conf files as templates and use the temlpate modiule from ansible to deploy it

now my question is
in that aproach of using template module how do i version the files?

any suggestions for other methods of distributing the conf files?

Why not have one template with conditional lines based on the version
of the package that is installed? After setting the version of a
package to a fact or variable, you could do something like this in a
template:

<% if version == '1.3'>
settinga= foo
<% elf version == '1.4 >
setting_b = bar
<% else %>
setting_c = baz
<% endif %>

James

“in that aproach of using template module how do i version the files?”

Are you trying to deploy multiple versions of your application to different environments, for instance version 3 might be in development, while version 2 might be in prod?

Different people handle this in different ways.

Some people like to branch the ansible playbook repo, but you could also do something like James Martin shared above, or even have different roles for each version depending on complexity.

I am not trying to deploy multiple versions of the app
I am probably not being very clear on my requirements, sorry for that

I want to deploy app v1 and conf v32 for example
I am currently doing debian packaging because i want to version my confs
but i want to replace the conf packaging with the template module or other modules for that matter
but the question is how to version my confs ?
i can just use the template module but then there is not versioning of the conf files

How different are the different versions of the conf files?

new params or values
this is basicallt a local_seetings.py for a django app