ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Fedora - Automating Config File Modifications

    IT Discussion
    fedora configuration management cm tool automate config file sed
    4
    5
    826
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wrx7mW
      wrx7m
      last edited by wrx7m

      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.

      IRJI 1 Reply Last reply Reply Quote 1
      • JaredBuschJ
        JaredBusch
        last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • black3dynamiteB
          black3dynamite
          last edited by

          If the config files will be the same on each server, you could just scp your updated config to each server.

          wrx7mW 1 Reply Last reply Reply Quote 0
          • wrx7mW
            wrx7m @black3dynamite
            last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • IRJI
              IRJ @wrx7m
              last edited by IRJ

              @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

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post