running puppet from kickstart

603 views
Skip to first unread message

Evan Hisey

unread,
Apr 18, 2008, 2:01:59 PM4/18/08
to puppet...@googlegroups.com
I am having an annoying problem. I can not get puppetd to run from
the %post in kickstart on a centos 5 install. It runs fine after the
reboot. When in the installer it acts like it is just ignored. Has
anyone else had troubles with this?

Evan

Alaric

unread,
Apr 18, 2008, 2:23:43 PM4/18/08
to puppet...@googlegroups.com
As I recall, we has some trouble with this as well, our work around was to install puppet from the first boot script, and to have puppet apply it's configuration at that time. Thats given us very constant results!

-a

Paul Lathrop

unread,
Apr 18, 2008, 2:59:07 PM4/18/08
to puppet...@googlegroups.com

I know nothing about kickstart but it mught be realted to a problem I
had in Debian where the -w option (wait for cert) was set to 0 in the
init script, causing it to silently fail immediately rather than
waiting for a signed certificate. I modded our 'kickstart' (FAI)
config to replace the init script with one that had a sane wait for
cert value.

Hope that helps.

--Paul

Ashley Penney

unread,
Apr 18, 2008, 3:14:33 PM4/18/08
to puppet...@googlegroups.com
Try %post --chroot, it might need that.

Thanks,

ben

unread,
Apr 18, 2008, 3:15:20 PM4/18/08
to puppet...@googlegroups.com

You probably need to set the hostname before running puppetd, anaconda
doesn't set it.

this kickstart file, courtesy of dlutter, may be what you're looking for:

http://people.redhat.com/dlutter/kronolith-appliance/kronolith.cfg

Ashley Penney

unread,
Apr 18, 2008, 3:35:12 PM4/18/08
to puppet...@googlegroups.com
If you use cobbler, this is what I currently cobbled together (terrible pun!):

%post
/sbin/chkconfig --level 345 puppet on
/bin/echo "$IPOFPUPPETSERVER puppet" >> /etc/hosts
/bin/echo "nameserver $NAMESERVER" >> /etc/resolv.conf
hostname $hostname
# Write out the hostname to a file for reboot.
/bin/echo -e "NETWORKING=yes\nHOSTNAME=$hostname" > /etc/sysconfig/network
/usr/sbin/puppetd -o -v --tag no_such_tag --waitforcert 600

This relies on using --hostname=etc when creating a profile.  It's ugly but it works.

Evan Hisey

unread,
Apr 18, 2008, 4:23:05 PM4/18/08
to puppet...@googlegroups.com
> hostname $hostname
> # Write out the hostname to a file for reboot.
> /bin/echo -e "NETWORKING=yes\nHOSTNAME=$hostname" > /etc/sysconfig/network
> /usr/sbin/puppetd -o -v --tag no_such_tag --waitforcert 600
>
> This relies on using --hostname=etc when creating a profile. It's ugly but
> it works.
>
>
Thanks guys, that was the missing piece of the puzzle. I was not
setting a host name for puppet to use. Lets see how that works .

Evan

David Lutterkort

unread,
Apr 20, 2008, 8:38:26 PM4/20/08
to puppet...@googlegroups.com

You can find some info about that on my blog[1] One of the important
things to remember is that anaconda does not set the hostname, and you
need to get it out of /tmp/netinfo if you want to run puppet during the
install. Of course, you can also delay the first puppet run until the
boot after installation, by just installing it and turning it on with
chkconfig.

David

[1]
http://watzmann.net/blog/index.php/2006/12/05/kickstarting_into_puppet


Gary Law

unread,
Apr 21, 2008, 6:28:07 AM4/21/08
to Puppet Users
On Apr 21, 1:38 am, David Lutterkort <dlut...@redhat.com> wrote:
> Of course, you can also delay the first puppet run until the
> boot after installation, by just installing it and turning it on with
> chkconfig.

This is the approach the Solaris package takes. If you install using
Jumpstart, puppet will run on first boot (there's an installation
option to change this behaviour) but not during the install process
itself.

Gary

Andreas Rogge

unread,
Apr 21, 2008, 7:07:02 AM4/21/08
to puppet...@googlegroups.com
Evan Hisey schrieb:

I already knew these issues from other software products, so I ususally
don't try to do anything from %post :)

What we actually do is the following:
We have a one-line install for puppet that can be invoked like this:

wget -qO- http://our.puppet.server/installpuppet | sh

So all I had to for kickstart was:
- make sure kickstart installs "wget" and "at" (ususally it just does that)
- configure mail-forward for root, so the mail from at won't get lost
- schedule installation using at. As at doesn't run in anaconda your job
will be queued for later (i.e. after first bootup)
- monitor my inbox for the mail from at to show up


So after all I just add something like the following to my ks-file:
%post
(
echo 'operato...@example.com' > /root/.forward
echo 'wget -qO- http://our.puppet.server/installpuppet | sh' | at now
) > /root/post.log 2>&1

Hope that helps.

Regards,
Andreas

--
Solvention
Egermannstr. 6-8
53359 Rheinbach

Tel: +49 2226 158179-0
Fax: +49 2226 158179-9

http://www.solvention.de
mailto:in...@solvention.de

Evan Hisey

unread,
Apr 24, 2008, 4:40:46 PM4/24/08
to puppet...@googlegroups.com
> I already knew these issues from other software products, so I ususally
> don't try to do anything from %post :)
>
> What we actually do is the following:
> We have a one-line install for puppet that can be invoked like this:
>
> wget -qO- http://our.puppet.server/installpuppet | sh
>
> So all I had to for kickstart was:
> - make sure kickstart installs "wget" and "at" (ususally it just does that)
> - configure mail-forward for root, so the mail from at won't get lost
> - schedule installation using at. As at doesn't run in anaconda your job
> will be queued for later (i.e. after first bootup)
> - monitor my inbox for the mail from at to show up
>
>
> So after all I just add something like the following to my ks-file:
> %post
> (
> echo 'operato...@example.com' > /root/.forward
> echo 'wget -qO- http://our.puppet.server/installpuppet | sh' | at now
> ) > /root/post.log 2>&1
>
Okay this was the magic solution. It also provided a solution to
another problme I had not yet started on :)

Evan

Reply all
Reply to author
Forward
0 new messages