Efficient management of configuration files through automation

2 min read published on September 3 2024

Auto configuration Оne of IPCOS’ clients has plants all around the globe that work from different locations and development environments. The components of the project IPCOS was hired to develop use a set of configuration files, which are different for each site and environment (Stage, Dev, Acceptance, Production). Adding new properties manually or changing values in these files is time-consuming and error-prone, often leading to inconsistent and incorrect configurations. Furthermore, introducing new technologies would result in frequent configuration changes, which would be unmanageable in manual updates.             

To fulfil the client brief, IPCOS initiated the development of a tool to manage the different configuration files.

Methodology and tools

The tool we used for this project was a C# program that utilizes data files stored in JSON. The program instantiates template files of the configuration files and produces the actual configuration files for each site and environment. The templates contain tags, which will be replaced by a regular expression of the data values. The data values themselves can also contain these tags, which means that the text replacement will be applied recursively until no more tags remain.

The methodology we chose grouped the data files into different levels:

               - Global data files

               - Environment-specific data files

               - Site-specific data files

               - Site and environment-specific data files

The same data value name can appear on multiple levels, but the most specific one will be used when resolving the value of that name. By using tags in values, it is possible to define a template at a higher level, where the components of the template will be defined at more specific levels.

As a result, it was possible to build the data files in a normalised way.

Timescale and outcome

 

Building the tool took a couple of days. Converting the existing data files to templates and extracting the data tags took about a week. The work was done by a single person. The tool is now used by the entire global team.     

Changing the configuration files used to take hours when done manually, while it is now a matter of minutes. All changes are now guaranteed to be consistent over all configuration files, reducing the number of bugs due to incorrect configurations. The entire team accepts the tool, and all developers know how to run it. There is no fear of making changes to configuration files because everyone is confident that it is done correctly and fast.