I have an ansible playbook with different roles. In each role I would like to add several lines to the same configuration file. For example, adding sections to a ini
file:
[section] param1=value1 param2=value2
What would be the best way to accomplish this?
Is it possible to concatenate template pieces? For example:
[section] param1={{ value_var1 }} param2={{ value_var2 }}
Best Answer
By your example i would do like this
Of course in each role you have diferent tags like ANSIBLE_ROLE_X_APPLIED
Or something based on this idea
EDIT: If this is really ini file - i better play with ansible core module ini_file