Managing configurations of multiple servers and environments are one of the significant uses of Ansible. But these configuration files may vary for each remote server or each cluster. But apart from some few parameters, all other settings will be the same.
Creating static files for each of these configurations is not an efficient solution. And It will take a lot more time and every time a new cluster is added you will have to add more files. So if there is an efficient way to manage these dynamic values it would be beneficial. This is where Ansible template modules come into play.
A template in Ansible is a file that contains all your configuration parameters, but the dynamic values are given as variables. During the playbook execution, depending on the conditions like which cluster you are using, the variables will be replaced with the relevant values.