1

I'm curious to know if anyone has any suggestions on the best way to patch configuration files for software products that may contain custom settings.

I'm familiar with diff, patch, diff3, etc... but those don't patch the differences in the files if not captured properly.

What I'm looking to do is push out a bunch of updates quickly and easily that would modify default settings in a configuration file that would exist and if they do not exist then add them, while at the same time maintaining and preserving any custom settings that a customer may have added so they do not lose their configurations and the layout of the file.

I have various products that are in various formats like key/value, XML, etc. that I'm trying to determine what is the best course of action to manage over the long run instead of writing various parsers and scripts to do what I need to do.

I like the simplicity of diff and patch but, again, need to preserve custom configurations.

Right now after some initial testing it looks like my only course of action is custom scripts and parsers unless anyone else has any suggestions and/or has done something like this in the past.

GregL
  • 9,370
  • 2
  • 25
  • 36
jr102
  • 11
  • 1
  • Tricky, what happens if you need to modify a value that a customer has set to something that conflicts with a security change? Say, ssl ciphers, as an example. – thrig Sep 11 '15 at 14:29
  • Yes those we know are tricky and are planning to manage the security items for them which we would say are the baseline security items that we want to always push out and manage. But things we give flexibility on that they may set or add we don't want to touch and leave in place. I know it's tricky which is why I was trolling for other ideas or suggestions. I'm realizing I'm heading down the parser/scripts route. – jr102 Sep 11 '15 at 16:59
  • All configuration management systems have some way of doing this. Which one are you using? – Michael Hampton Sep 11 '15 at 20:10
  • I don't know if this impacts your answer or not but the thought for the initial question was we are pushing updates out to configuration files. For example, say your my.cnf contains "port=3306". Another instance of MySQL my.cnf has "port=4410". I want to push certain updates out to all of these servers and don't care about the port directive, but want to merge my changes with yours. Almost like taking only the additions from the diff command. So we wouldn't be maintaining anything in a CM system. But for now, its Subversion. – jr102 Sep 16 '15 at 15:54

0 Answers0