Fedora - Automating Config File Modifications
-
Without using a CM tool, what is the easiest way to automate modifications to several config files across 7-8 servers? I was looking at sed, but am not sure if there is a better tool that isn't a CM.
More specifically, I have several Fedora servers running squid proxy. From time to time, I need to modify the config file to whitelist a particular domain. Because I will soon have a few more servers, I would like to automate these type of file updates so I don't have to manually go into each server's config and copy and paste stuff in to certain sections; some information is specific to a particular server, where as this section would be universally necessary on all servers. So, I would be inserting lines in specific sections.
I intend to move to some sort of CM for this stuff in the future, but I need to get these going sooner than I could learn the CM tool.
-
Write a script. Create a default config on each server that has the server specific information on each one. In the config leave a marker that you can use a regular expression to find and then your script will find out regular expression and replace it with your list. Design your scriptTo connect to server one copy the duck default config to the running thing and then use regular expression to replace the marker with your list of servers. In the script connect to server to and does the same thing. Etc.
-
If the config files will be the same on each server, you could just
scp
your updated config to each server. -
@black3dynamite said in Fedora - Automating Config File Modifications:
If the config files will be the same on each server, you could just
scp
your updated config to each server.There might be some that will be identical. A file transfer had also occurred to me.
-
@wrx7m said in Fedora - Automating Config File Modifications:
Without using a CM tool, what is the easiest way to automate modifications to several config files across 7-8 servers? I was looking at sed, but am not sure if there is a better tool that isn't a CM.
More specifically, I have several Fedora servers running squid proxy. From time to time, I need to modify the config file to whitelist a particular domain. Because I will soon have a few more servers, I would like to automate these type of file updates so I don't have to manually go into each server's config and copy and paste stuff in to certain sections; some information is specific to a particular server, where as this section would be universally necessary on all servers. So, I would be inserting lines in specific sections.
I intend to move to some sort of CM for this stuff in the future, but I need to get these going sooner than I could learn the CM tool.
Sync with a s3 bucket hourly. Then you only need to update on s3