[rescue] off topic - red hat linux book
Robert Darlington
rdarlington at gmail.com
Wed Oct 21 15:04:23 CDT 2009
One of the things we did at a former job was to setup a series of NFS
shares, always mounted in the same location on any given *nix platform.
Each of these shares was setup the same way but with binaries compiled for a
particular target platform. This way we could write scripts that always
behaved as expected no matter the OS. Of course we checked what the OS was
in a lot of these scripts and branched depending on the test. This also
allowed cfengine scripts to be written more generically.
One of the bad things I saw done was seeing admins (and I use this term
loosely) setup peoples' shells using these NFS mounted directories. It
seemed like a great idea, always getting the most up to date version, but
the second a switch goes out between your building and the one hosting the
data, entire divisions couldn't log in!
-Bob
On Wed, Oct 21, 2009 at 12:54 PM, Ray Arachelian <ray at arachelian.com> wrote:
> Patrick Finnegan wrote:
> > GNU cfengine, Reductive Lab's Puppet, etc. They're $0.
> >
> >
> I just script things and have ssh rsa/dsa keys everywhere without
> needing anything more than ssh.
>
> I keep a list of machines with their attributes in a text file, then
> setup my .bashprofile to build aliases to the hostname like so:
>
> i.e.
> host1 solaris production newyork
> host2 linux qa california
> ...
>
> for i in `cat ~ray/machine_list | cut -f1 -d' '`
> do
> alias $i="ssh -2 -i ~ray/.ssh/id_rsa $i"
> done
>
> So that lets me get on a box by name. I could do without the -i param
> to pass the key, but sometimes I'm sudo'ed to root so having it
> explicitly there helps.
> (this is off the top of my head, but that's what the scripts that do
> this look like, just to give you an idea. watch out for typos. I don't
> want to post the actual ones as they're on work machines and might fall
> under ownership of $work even though I wrote them, though they're quite
> obvious and generic.)
>
> If I want to execute something on all or some of the machines I do this:
>
> for i in `cat ~ray/machine_list | grep prod | cut -f1 -d' '`; do scp -o
> "protocol 2" -i ~ray/.ssh/id_rsa -p /var/tmp/somefile.sh $i:/tmp/; ssh
> -2 -i ~ray/.ssh/id_rsa ray@$i "sudo /var/tmp/somefile.sh; rm
> /var/tmp/somefile.sh" 2>&1 >/tmp/ray/output/$i.out; done
>
> Then of course I can look at the outputs of these and grep for fail or
> success, etc.
>
>
> There's also stuff like cluster-ssh if you want to open multiple windows
> at once and have the same commands run everywhere, etc.
> _______________________________________________
> rescue list - http://www.sunhelp.org/mailman/listinfo/rescue
More information about the rescue
mailing list