On Sun, Aug 27, 2006 at 06:55:14PM +0200, Thorsten Sandfuchs
wrote:> --------
> define preseed (file, classname, section = "classes"){
> file {
> "/tmp/$file":
> mode => 600,
> source =>
> "puppet://$servername/config/$section/$classname/preseed/$file"
> }
> exec {
> ["cat /tmp/$file | debconf-set-selections",
> "if [ -f /tmp/$file ]; then rm /tmp/$file; fi"]:
> cwd => "/",
> path => "/usr/bin/:/usr/sbin/:/bin"
> }
> }
I''d be inclined to split that exec into multiple parts, and put a
"require =>
file["/tmp/$file"]" on the first one and a "require =>
exec["first-one"]" on
the second.
> Now I can install a "package" as desired. Buf if the package is
installed, the
> preseeding never stopps... It preseeds the information on every
puppet-run...
>
> Is there a way to only trigger the "preseed" if the package is
> upgraded/installed?
Not that I can think of at the moment, although you could perhaps put an
unless into the important exec object that checks whether a relevant config
item is present in the Debconf database, but that would require you to
specify a question in each preseed object, which would be teh suck.
The answer, as Luke says, is pre-run subscription.
- Matt
--
<FreeFrag> The most secure computer in the world is one not connected to
the
internet. Thats why I recommend Telstra ADSL.
-- bash.org/?168859