Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Centralized web based configuration

by jalewis2 (Monk)
on Jul 17, 2005 at 22:32 UTC ( #475600=perlquestion: print w/replies, xml ) Need Help??
jalewis2 has asked for the wisdom of the Perl Monks concerning the following question:

I have several linux boxes that process data. They are all identical with some minor config file changes. I was thinking I could make it easy to manage these servers by having them check into a central server where I kept up to date configurations for each server. I am also thinking I could create an interface for editing the configs.

Has this been done? I'm not looking for anything fancy and most of the apps I have seen try to do too much and they seem bloated for my purpose.

Is there anything I should keep in mind? I figure I would store the configs in a directory by hostname and I would need to make sure none of the processing was in progress when I updated the config file. Anything else?

**Update: To clarify, yes I will be doing this in perl. I mention my platform because there are apps that do this kind of config management. Cfengine is an example, but it seems like overkill for my purpose.

Replies are listed 'Best First'.
Re: Centralized web based configuration
by ww (Archbishop) on Jul 17, 2005 at 22:40 UTC
    are you asking if you can do this with perl? If so, almost certainly, yes. But if so, you may also want to show us what you've tried, and id your difficulties...

    If not, this would be better asked (or even better, 'studied/researched') on a linux-oriented site.

      Yes, I plan to do it in perl, but don't have any code. I am curious to know if anyone else has attempted something similar and if there are gotchas that I haven't considered.

      Maybe even some pointers to examples that people have experience with.

        I've personally never tried it, just because of the number of gotchas. Of course, your risk evaluation is going to be different from mine, so you'll have to judge for yourself if the benefits outweigh the risks.

        • Someone with access to the central server can modify any of the services set to call in, without needing explicit permission to any of the other systems.
        • The client system needs to verify that the file is clean before installing, or it may break the service.
        • How do you force a service to roll back if something goes wrong?
        • (basic issues with verifying who gave you the file, etc, but those can be taken care of with PGP signing, and SSH known hosts)
        • How much time slop do you have if you're doing pull, rather than push?

        I'd rather push instead of pull -- although it might be tricker to have multiple machines all come up in a tight window of time, I'd rather have the responsiveness of knowing that I could connect to the server, and have the central server get an immediate report that something went wrong. I don't make changes often enough to make it so that the systems check in every 5 minutes or so, and I don't want to have to potentially wait an hour for the next system checkin.

        Of course, my current systems aren't all that similar, so it's not worth my putting something together. If I were going to do it, though, I'd use Expect from the central server. Although this doesn't fix all of the risks that I mentioned, it makes it so I don't have to maintain this code as a service on each of the systems (as I wouldn't trust changes to this code being pulled), and I'd require some sort of a manual password entry to kick off the update. (I might store the passwords to the individual systems in a single encrypted file, if that was considered to be an acceptable risk)

Re: Centralized web based configuration
by waswas-fng (Curate) on Jul 18, 2005 at 04:16 UTC
    I do something kind of like this with PAR, I have a bunch of modules/configfiles that tend to change often and get used on a bunch of linux boxes, with PAR you can:
    use PAR; use lib ''; use MyConfig; # always updated..

Re: Centralized web based configuration
by ghenry (Vicar) on Jul 18, 2005 at 08:23 UTC

    Why not try storing all your configs etc. in svk and then in your programs/scripts use SVK::Command to update each server/directory?


    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a Just ask!!!
Re: Centralized web based configuration
by wazoox (Prior) on Jul 18, 2005 at 10:21 UTC
    You can have a look at cfengine and cfperl. Cfengine is very complex but it's worth learning if you really have to manage lots of machines (now or in the mid-term).
Re: Centralized web based configuration
by socketdave (Curate) on Jul 18, 2005 at 14:55 UTC
    You may want to consider rsync, at least for the file transfer part of the job. Keep a config without any machine specific stuff in one directory, write a script to build the directories for each machine from the generic config then rsync from each machine by a cron job, or manually.
Re: Centralized web based configuration
by TedPride (Priest) on Jul 18, 2005 at 06:28 UTC
    Just set up cron tabs (or scheduled processes, depending) on all the machines to contact your central server at some specific time each day and update the config files. The method you use doesn't matter as long as it's secure. Then, since you know what time the config files are updated, all you have to do to prevent read problems is avoid that time when modifying your configs.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://475600]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2018-06-21 18:47 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.