Re: automating debconf
On Sun, Feb 18, 2001 at 03:34:17PM +0100, Arthur Korn wrote:
> Craig Sanders schrieb:
> > it wouldn't be a problem at all (in fact, it would be a fantastic tool!)
> > if debconf was also able to accept answers to questions from stdin.
>
> This would be a suboptimal fix.
what's "suboptimal" about making debconf work like any other unix tool?
one of the strengths of unix is that data & configuration details can
be piped around and transformed and manipulated using the whole swag of
unix text manipulation tools. plain-text configuration is a strength,
not a weakness.
while some special-purpose database thingy would be good for those
who like to work like that, a solution that allows generic piping of
configuration data in and out of debconf would work just fine for the
sysadmins out there who have years of experience in the traditional unix
way of doing things.
this isn't an either/or thing....a pipe method could be implemented
fairly quickly because it's a damn simple thing to do, and intuitively
obvious to unix-heads - and that could be available and working while
people implement an alternative database library for debconf.
debconf's major flaw at the moment is that it is such a radical
departure from traditional unix techniques. a pipe method would solve
that problem by making it "backwards-compatible".
don't get me wrong: i like debconf and i think it's a very useful
tool...but it would be vastly more useful if it could be used in a
unix-like manner.
it would open up all sorts of possibilities too. e.g. copying
configuration data from one machine to another could be as simple as
something like:
debconf --extract postfix | ssh remote.hostname debconf --configure postfix
and if you needed to transform one particular variable to customise it for
the remote machine:
debconf --extract postfix | \
sed -e "s/localhostname/remotehostname/gi" | \
ssh remote.hostname debconf --configure postfix
now you can wrap that in a for loop to configure many machines at once:
for i in $( cat hosts ) ; do
debconf --extract postfix | \
sed -e "s/localhostname/$i/gi" | \
ssh $i debconf --configure postfix
done
this is the unix "small tools" approach to problem-solving in action. it
works, and it works extremely well...it has worked extremely well for
over 20 years. it's very flexible and it allows people to do common or
"standard" things easily without sacrificing their ability to do unusual
or oddball things that they need to do for some reason or other. it
lends itself to customised automation tasks.
craig
--
craig sanders <cas@taz.net.au>
GnuPG Key: 1024D/CD5626F0
Key fingerprint: 9674 7EE2 4AC6 F5EF 3C57 52C3 EC32 6810 CD56 26F0
Reply to: