doing "regenerative" packages (ark 1)
Will Partain <[email protected]>
| Newsgroups | gmane.comp.sysutils.ark.devel |
|---|---|
| Message-ID | <[email protected]> |
Nothing new here, but... I ended up noodling a little w/
what you might call "regenerative" packages -- I would
*KILL* for a good name... -- and was pleased that it
worked.
First: a r-ve package is one where you routinely change the
"source" and need to deploy/reveal it over and over again.
Automount maps, export lists, /etc/sudoers, /etc/hosts, and
so on. Your systems change, you change the "system source"
that records things, and you need to re-splat all the files
that depend on those facts.
In my case, I was doing automount maps and /etc/exports
files. (I happen to generate these from "dchunks" xml
files, but it doesn't matter.)
Here's how I want these things to work:
* I want to regenerate all these files every night, but
*not* put them into production [reveal]. Simple reason:
these are the kinds of files that, if messed up (across
every host), leave you with a very dead/hobbling system.
* The sidai stuff has a "diffing deploy" -- it goes right up
to "deploy" on every host and then diffs that against the
previously-revealed version.
* I want to look at those diffs before anything dangerous
happens.
If I'm happy with what I see, do the reveal.
Even w/ ARK 1, we have enough machinery to do this! (Albeit
clunkily) Here's my playing-around script to do
diffing-deploy of automount maps and /etc/exports:
#! /bin/sh
HOSTS='--hosts=slimy,slinger,slicker' # or --hosts=. ?
VERBOSE='' # --verbose
for pkg in \
automount-maps \
etc-exports \
; do
# remove the offending ark-state info:
arkpkg reveal --use-deps=min --invalidate-node=$pkg--CURRENT-configure --invalidate-match-pattern=. $HOSTS $pkg--CURRENT | xargs /bin/rm -f
# only re-do back up to 'deploy' (really a "diffing deploy", usually):
arkpkg deploy $HOSTS --use-deps=min $VERBOSE $pkg--CURRENT
# if happy with what you see, you could finish the job with:
# arkpkg reveal $HOSTS --use-deps=min $VERBOSE $pkg--CURRENT
done
All I have to do is add more "regenerative packages of
interest" to the list, and I've got it. Hooray!
(I'll say more if anybody cares.)
Will