Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Managing multiple systems with identical hardware
Date: Fri, 13 Dec 2013 01:49:16
Message-Id: CAN0CFw00_ze+1yys=0EU=PiwPefsa7ggozNGjUoijn+r39Ps6Q@mail.gmail.com
In Reply to: Re: [gentoo-user] Managing multiple systems with identical hardware by "Poison BL."
1 >> I'm about to embark on this (perilous?) journey and I'm wondering if
2 >> anyone would make a comment on any of the questions in the last
3 >> paragraph below. This is basically my plan for setting up a bunch of
4 >> systems (laptops) in an office which are hardware-identical to my own
5 >> laptop and creating a framework to manage them all with a bare minimum
6 >> of time and effort.
7 >>
8 >> Thanks,
9 >> Grant
10 >>
11 >>
12 >>>>>>>> I see what you desire now - essentially you want to clone your laptop
13 >>>>>>>> (or big chunks of it) over to your other workstations.
14 >>>
15 >>> I've been working on this and I think I have a good and simple plan.
16 >>>
17 >>> My laptop roams around with me and is the "master" system. The office
18 >>> router is the "submaster" system. All of the other office systems are
19 >>> "minion" systems. All of the systems are 100% hardware-identical
20 >>> laptops. All of the minions are 100% software-identical.
21 >>>
22 >>> I install every package that any system needs on the master and create
23 >>> an SSH keypair. The only config files that change from their state on
24 >>> the master are: /etc/conf.d/hostname, /etc/conf.d/net,
25 >>> /etc/ssh/sshd_config, /etc/shorewall/*. I write comments in those
26 >>> files which serve as flags for scripted changes.
27 >>>
28 >>> I write a script that is run from the master to the submaster, or from
29 >>> the submaster to a minion. If it's the former, rsync / is run with
30 >>> exceptions (/usr/portage, /usr/local/portage, /var/log, /tmp, /home,
31 >>> /root but /root/.ssh/id_rsa_script* is included), my personal user is
32 >>> removed, a series of workstation users are created with useradd -m,
33 >>> services are added or removed from /etc/runlevels/default, and config
34 >>> files are changed according to comment flags. If it's the latter,
35 >>> rsync / is run without exceptions, services are added or removed from
36 >>> /etc/runlevels/default, and config files are changed according to
37 >>> comment flags.
38 >>>
39 >>> All user info on the submaster and minions would be effectively reset
40 >>> whenever the script is run and that's fine. Root logins would have to
41 >>> be allowed on the submaster and minions but only with the SSH key.
42 >>> There are probably more paths to exclude when rsyncing master to
43 >>> submaster.
44 >>>
45 >>> That's it. No matter how numerous the minions become, this should
46 >>> allow me to keep everything running by administrating only my own
47 >>> system, pushing that to the submaster, and having the submaster push
48 >>> to the minions. I've been going over the nitty-gritty and everything
49 >>> looks good.
50 >>>
51 >>> What do you think? Is there anything inherently wrong with rsyncing /
52 >>> onto a running system? If there are little or no changes to make,
53 >>> about how much data would actually be transferred? Is there a better
54 >>> tool for this than rsync? I know Funtoo uses git for syncing with
55 >>> their portage tree.
56 >>>
57 >>> - Grant
58 >>
59 >
60 > Only thing that comes immediately to mind in rsyncing an overwrite of
61 > / is that any process that's running that goes looking for libraries
62 > or other data after the rsync pulls the rug out from beneath it might
63 > behave erratically, crash, kick a puppy, write arbitrary data all over
64 > your drive. Also, it's somewhat important to be careful about the
65 > various not-really-there mounts, /dev, /sys, /proc... /run's probably
66 > touchy too, and /var has a few pieces that might be in use mid-sync
67 > and choke something along the way. My idea on that would be... build
68 > an initramfs that:
69
70 What if the push is done while no one is logged in to the system(s)
71 being updated? I could also exclude /dev, /sys, /proc, and /run and
72 reboot after the update. If that's not good enough, what if I boot
73 the systems being updated into read-only mode before updating them?
74 I'm hoping to keep the process as simple as possible.
75
76 - Grant
77
78
79 > 1) boots to a script
80 > a) warns the user that it's hungry and that feeding it will be
81 > dangerous to any non-backed-up data, with prompt
82 > b) warns the user again, with prompt ('cause watching an rsync roll
83 > by that eats that document you just spent 3 weeks on isn't fun)
84 > 2) mounts / in a working directory
85 > 3) rsyncs the new data from the sub-master
86 > 4) kicks off a script to update a hardware keyed (mac address is good
87 > for this) set of settings (hostname, etc)
88 > 5) reboots into the new system.
89 >
90 > For extra credit... sync /home back to the sub-master to prevent
91 > overfeeding the beast.
92 >
93 > --
94 > Poison [BLX]
95 > Joshua M. Murphy

Replies

Subject Author
Re: [gentoo-user] Managing multiple systems with identical hardware Alan McKinnon <alan.mckinnon@×××××.com>
Re: [gentoo-user] Managing multiple systems with identical hardware Neil Bothwick <neil@××××××××××.uk>