Help setting up Ubuntu preseed for Puppet Clients

975 views
Skip to first unread message

Jfro

unread,
Aug 2, 2011, 4:39:23 PM8/2/11
to puppet...@googlegroups.com
I have another newbie question:

I am installing Ubuntu 10.4 LTS via a preseed file for a classroom computer lab.

Can anyone help me with installing Puppet client via the preseed file?  Step by step instructions would be greatly appreciated.

Here's what I think I need to do:

1. Install the Puppet package.  I'm using the command below.  Is this correct?

d-i pkgsel/puppet

2.  Set up the /etc/puppet/puppet.conf to include the Puppet Master server info.  I think I need to host the puppet.conf file on my preseed server and place is on the new machine.  What is the command to do this?

3.  Have puppet client send it's key to the master.  Can I run a late_command script to accomplish this?  Can you provide the script?

4.  What else am I missing?

Sorry I'm such a newbie, but I appreciate your help.  This will eventually help manage a great computer lab for the kids.

Thanks.


Bruno Leon

unread,
Aug 2, 2011, 5:28:07 PM8/2/11
to puppet...@googlegroups.com
 1 -
# Individual additional packages to install
d-i pkgsel/include string puppet

2 -
Set up DNS so that client can resolve puppet to the puppetmaster

3 - Why do that ? Just sign the request when it comes

4- Have Puppet start automatically
d-i preseed/late_command string sed 's/no/yes/' /target/etc/default/puppet > /root/puppet; cp /root/puppet /target/etc/default/puppet;

Jfro

unread,
Aug 2, 2011, 10:01:52 PM8/2/11
to puppet...@googlegroups.com
Bruno,

Thanks so much for taking the time to help me out!  Your expertise saved me hours of frustration.

1.  This was very clear, thanks!

2.  Can you point me in the right direction for setting up DNS?  On my test systems I just set the puppetmaster server in the puppet.conf file.  Is there a better way to tell puppet which server is its master?

3.  Once puppet is installed will it automatically connect to the puppetmaster?  One my test clients I was running this command:

puppetd --server puppet.example.com --waitforcert 60 --test

Is it not necessary to do so?

4.  Thanks for the command.  If you get a chance can you tell me what is happening here?

Again, I'm grateful for your help!


Greg

unread,
Aug 3, 2011, 2:16:05 AM8/3/11
to Puppet Users
Jfro,

I did basically the same for Ubuntu 11.04... Personally, I found I
needed a postinstall script to finish the job. Mainly because Ubuntu
populates /etc/default/puppet with an environment variable START,
which defaults to 'no'...

So basically I had:

d-i pkgsel/include string openssh-server puppet curl

Openssh-server was for debug in the event of pain (I had a local user
created in the preseed file with a known password and full sudo access
as well so I could get into the box if needed), curl is needed in the
postinstall script.

Now I'm sure someone will kick me and tell me this isn't how you do
postinstall scripts in Ubuntu, but heres how I did it:

d-i preseed/late_command string chroot /target sh -c "/usr/bin/curl -
o /tmp/postinstall http://url.com/postinstall && /bin/sh -x /tmp/
postinstall"

The contents of postinstall for updating the Puppet config are pretty
simple:

#!/bin/sh
CURL=/usr/bin/curl
${CURL} -o /etc/puppet/puppet.conf http://url.com/puppet.conf
${CURL} -o /etc/default/puppet http://url.com/default-puppet

I had a couple of reasons for pushing in a puppet.conf as well... I
wanted report=true set so that the first (and usually largest and most
complicated) puppet run got included in puppet dashboard (Ubuntu
defaults mean that you wouldn't get that). I also had a puppet host
that wasn't named puppet (and wouldn't be)... Again, the default
config in Ubuntu wasn't applicable for me...

/etc/default/puppet was updated just so that it would start
automatically next time around.

Hope that helps!

Greg

Ohad Levy

unread,
Aug 3, 2011, 2:30:08 AM8/3/11
to puppet...@googlegroups.com
On Tue, Aug 2, 2011 at 11:39 PM, Jfro <jason....@gmail.com> wrote:
> I have another newbie question:
> I am installing Ubuntu 10.4 LTS via a preseed file for a classroom computer
> lab.
> Can anyone help me with installing Puppet client via the preseed file?  Step
> by step instructions would be greatly appreciated.

as Foreman [1] already provides provisioning support for
Debian/Ubuntu, you can simply copy and reuse the preseed default
templates[2].

Ohad

[1] - http://theforeman.org
[2] - https://github.com/ohadlevy/foreman/blob/develop/app/views/unattended

Ohad

> Here's what I think I need to do:
> 1. Install the Puppet package.  I'm using the command below.  Is this
> correct?
>
> d-i pkgsel/puppet
>
> 2.  Set up the /etc/puppet/puppet.conf to include the Puppet Master server
> info.  I think I need to host the puppet.conf file on my preseed server and
> place is on the new machine.  What is the command to do this?
> 3.  Have puppet client send it's key to the master.  Can I run a
> late_command script to accomplish this?  Can you provide the script?
> 4.  What else am I missing?
> Sorry I'm such a newbie, but I appreciate your help.  This will eventually
> help manage a great computer lab for the kids.
> Thanks.
>

> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/wCO0259HWvoJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

Jfro

unread,
Aug 7, 2011, 3:01:44 PM8/7/11
to puppet...@googlegroups.com
This is extremely helpful!

I didn' t realize that puppet was not set up to install upon boot.

I hoping to finalize my preseeed file soon and I'll let you know how it went.

Thanks,
Jason
Reply all
Reply to author
Forward
0 new messages