views:

38

answers:

3

Hi, We're writing a web-based tool to configure our services provided by multiple servers. This includes interfaces configuration, dhcp configs etc. etc.

Having configs in database and views that generate proper output, how to send it/make it available for servers?

I'm thinking about sending it through scp and invoking reload command to services through ssh. I'm also thinking about using Func to do all the job, as this is Python tool and will seemingly integrate with python-based (django) config tool.

Any other proposals?

A: 

You can take a look at Fabric.

As an example, this is an adapted excerpt from one of my backup scripts that starts Mercurial server on remote host and pushes local changesets there:

from fabric.api import *
env.hosts = ['[email protected]']

def mybckp():
    run('cd ~/somedir; hg serve -a 111.222.111.222 -d') # start mercurial server in daemon mode
    local('hg push')  # push local changesets

To execute it, I simply type:

fab mybckp

Basically, what Fabric offers is easy&convenient SSH access to shell of one more (remote) hosts, from inside of Python script.

Tomasz Zielinski
Looks promising, now I neew to investigate Fabric vs Func.
JPG
A: 

I think you are looking for Puppet and Foreman to manage puppet (create groups of servers).

There are many ways to do this, including Chef, Bcfg2, Capistrano etc. Puppet has biggest "lead" now. There is definitely a learning curve, but the results are worth it.

You could keep your servers config files on the puppet master (in version control). And when you deploy the latest config files on the master, puppet clients can automatically pull them and restart services. Puppet "templates" can dynamically generate config files for each server.

Puppet has "Providers" for things like Packages(apt, yum), Files and OS awareness.

Bash
A: 

It really depends what you're intending to do, as the question is a little vague. The other answers cover the tools available; choosing one over the other comes down to purpose.

Are you intending to manage servers, and services on those servers? If so, try Puppet, CFEngine, or some other tool for managing server configurations.

Or, more specifically, are you looking for a deployment/buildout tool that talks to servers? So that you can type in something along the lines of "mytool deploy myproject", and have your project propagate to all the servers? In which case, fabric would be the tool to use.

Generally a good configuration will consist of both anyway... but for what it's worth, from the sound of it (managing DHCP/network/etc.), Puppet's the way to go.

frio