You are not logged in.

#1 2011-06-07 11:34:13

ChojinDSL
Member
From: Germany
Registered: 2010-11-30
Posts: 64
Website

How do you udate an army of Arch Servers?

I was just wondering, what strategies do you guys use when updating multiple arch servers?
Obviously logging in to each one and doing pacman -Syu or yaourt -Syau would be too time-consuming.

Could you post some tips or script examples of how you manage updating an arch server farm.

Currently I just use a very simple stupid bash script, which just pipes a pacman or yaourt command via an ssh shell to each server, on after the other.

Last edited by ChojinDSL (2011-06-07 11:36:36)

Offline

#2 2011-06-07 11:39:05

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How do you udate an army of Arch Servers?


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2011-06-07 12:14:15

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: How do you udate an army of Arch Servers?

It's a nasty hack, but it helps me keep track of where I'm up to.... You haven't defined what you call an "army"... Wolfram Alpha tells me it is 13.36 million:
http://www.wolframalpha.com/input/?i=ho … an+army%3F

/home/fukawi2 $ cat ~/bin/make-patch-host-list.pl 
#!/usr/bin/perl

use strict;
use warnings;

my $filter_domain;
$filter_domain = shift if @ARGV;

my @a=<>;
my %hosts;
my $max_host_chars=0;

# get all the hostnames from stdin and store them
# in a hash keyed by domain for sorting purposes.
foreach (@a) {
    if (m/^host\s+.*\s+(\S+\.\S+)\s+/i) {
        my $hn = $1;

        # skip wildcards
        next if ($hn =~ m/\*/);

        # we need to know the longest hostname for
        # formatting output later.
        $max_host_chars = length($hn) if (length($hn) > $max_host_chars);

        $hn =~ m/\A([^\.]+)\.(.+)\z/;
        my $hostpart = $1;
        my $domain = $2;

        if (! $filter_domain or $domain =~ m/\A$filter_domain\z/i) {
            # reverse the host part and domain part
            # (eg, example.com.host01)
            # this lets up sort by domain for output purposes
            my $rev_hn = "$domain.$hostpart";
            $hosts{$rev_hn} = $hn;
        }
    }
};

if (%hosts) {
    $max_host_chars += 5;
    my $output_fmt = "  ==> %-${max_host_chars}s[  ]\n";

    print "=== UPDATE CHECKLIST ===\n\n";
    printf("Filtered for hosts in domain: %s\n\n", $filter_domain) if ($filter_domain);
    
    foreach my $domkey (sort(keys %hosts)) {
        my $hn = $hosts{$domkey};
        printf($output_fmt, $hn);
    }
    
    printf("\nTotal Hosts: %u\n", scalar(keys %hosts));
}

exit 0;

Offline

#4 2011-06-08 14:29:22

JohnnyRogers
Member
Registered: 2009-10-24
Posts: 32

Re: How do you udate an army of Arch Servers?

fukawi2 wrote:

You haven't defined what you call an "army"... Wolfram Alpha tells me it is 13.36 million

Naaw, that's for all armies. It says China has the biggest army at 1.4 million people, so presumably an army wouldn't need to be bigger than that, and could presumably be much smaller.

On topic, I'll have to take a look at Salt, it seems pretty awesome.

Last edited by JohnnyRogers (2011-06-08 14:29:59)

Offline

#5 2011-06-08 15:16:01

weltio
Member
From: Germany
Registered: 2009-04-05
Posts: 90

Re: How do you udate an army of Arch Servers?

Naaah... an army is obviously a couple of corps which are two or three divisions which consist of brigades...
obviously I cant say anything to topic

Offline

#6 2011-06-08 23:42:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: How do you udate an army of Arch Servers?

JohnnyRogers wrote:

Naaw, that's for all armies. It says China has the biggest army at 1.4 million people, so presumably an army wouldn't need to be bigger than that, and could presumably be much smaller.

My bad, you are correct.

JohnnyRogers wrote:

On topic, I'll have to take a look at Salt, it seems pretty awesome.

Indeed... Although I can't seem to find in the docs how to *use* it (only configure it and extend it).

Offline

Board footer

Powered by FluxBB