Puppet install on Debian Squeeze with Dashboard

Introduction

I had some time and started playing around with puppet. At first I was really frustrated with some sites giving documentation or guides that had errors that resulted in hours of debuging, and googling. So I would like to present my short but tested guide.

Config

The lab consists of only 1 host running kvm with a private cloud solution. Two machines were provisioned:

Puppet.test            10.10.16.100         2.6.32-5-amd64

test.test               10.10.16.101          2.6.32-5-amd64

db.test                      only an external mysql db server

Puppet node will be the puppetmaster and dashboard, but also will be used as a host.

Install

I decided to go with Puppetlabs own repositary, and have all updates done from their repo.

To quickly set up their source, we just need to download their deb file and install it. On both nodes run the following commands:

cd /tmp/
wget http://apt.puppetlabs.com/puppetlabs-release_1.0-3_all.deb
dpkg -i puppetlabs-release_1.0-3_all.deb
apt-get update

The apt repositary is set up and ready.

Puppetmaster

First lets start with puppet.test node. To install basic packages run:

apt-get install puppetmaster mysql-client

Then lets create the initial site.pp file. Some guides have sites.pp which is incorrect.

vim /etc/puppet/manifest/site.pp

Content:

class fsafdsfds {
file { "/tmp/testdsa":
ensure => file,
mode => 644,
owner => root,
group => root
}
file { "/tmp/test":
ensure => "directory",
}
}

# Two seperate entries so we can comment unneeded one
node test {
include fsafdsfds
}
node puppet {
include fsafdsfds
}

Also files.conf has reference to a folder not yet created, so lets create it:

mkdir /etc/puppet/files

then we can restart puppetmaster

/etc/init.d/puppetmaster restart

And we are done with puppetmaster.

Puppet-dashboard

First we need to install the package for the web frontend:

apt-get install puppet-dashboard

First lets edit database.yml:

vim /usr/share/puppet-dashboard/config/database.yml

And edit the production section:

production:
host: db.test
database: puppet
username: puppet
password: IamAsecret
encoding: utf8
adapter: mysql

then run following commands:

cd /usr/share/puppet-dashboard/
rake RAILS_ENV=production db:migrate

and edit :

vim /etc/default/puppet-dashboard

Uncomment following line:

START=yes

and finally edit /etc/puppet/puppet.conf

vim /etc/puppet/puppet.conf

and add:

[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
reports = store, http
reporturl = http://puppet.test:3000/reports/upload

And lets start dashboard:

/etc/init.d/puppet-dashboard restart

now if we navigate to puppet dashboard we will see a working website:

http://puppet.test:3000

Puppet-agent

First install puppet binaries on both nodes

apt-get install puppet

and edit the default config file:

vim /etc/default/puppet

and set

Start=yes

Make sure /etc/puppet/puppet.conf has following lines:

[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
server=puppet.test

And basic configuration is complete.

Lets sign client cert on server side. From client run following command:

root@test: # puppetd --server puppet.test --waitforcert 60 --test

and from server lets have a look:

root@puppet # puppetca --list --all

root@puppet:/usr/share/puppet-dashboard# puppetca --list --all
+ puppet.test (9A:D1:97:AA:CC:54:DF:87:B1:77:22:FF:2B:ED:47:1A) (alt names: DNS:puppet, DNS:puppet.test)
+ test.test (28:3E:09:12:55:55:61:88:F4:55:CC:BC:5E:D0:22:61)

(Output has been obfuscated.)

Lets sign the request:

root@puppet # puppetca --sign test.test

Test

To run some tests from client run following command:

puppetd --debug --test --server puppet.test

And lets test

ls -l /tmp

And viola the file and folder is created.
If you get errors regarding the Cert file a useful command is:

openssl x509 -text -noout -in /var/lib/puppet/ssl/certs/puppet.test.pem

Conclusion

Install is complete, I have to run tests to see how puppet can be provisioned with preseed, and how we can use it in the cloud, but the first step is complete.

Advertisements

Author: S4mur4i

Happy in the unhappy world.

3 thoughts on “Puppet install on Debian Squeeze with Dashboard”

    1. Hy,

      They changed the download link:

      http://apt.puppetlabs.com/

      [TXT] README.txt 18-Jul-2012 17:08 693
      [DIR] dists/ 03-Dec-2013 10:19 –
      [ ] keyring.gpg 03-Dec-2013 10:19 2.5K
      [DIR] pool/ 16-Oct-2013 10:50 –
      [ ] pubkey.gpg 03-Dec-2013 10:19 3.6K
      [ ] puppetlabs-release-lucid.deb 23-Apr-2013 12:36 3.3K
      [ ] puppetlabs-release-precise.deb 23-Apr-2013 12:36 3.3K
      [ ] puppetlabs-release-quantal.deb 23-Apr-2013 12:36 3.4K
      [ ] puppetlabs-release-raring.deb 23-Apr-2013 12:36 3.3K
      [ ] puppetlabs-release-saucy.deb 16-Oct-2013 10:34 3.3K
      [ ] puppetlabs-release-sid.deb 23-Apr-2013 12:36 3.3K
      [ ] puppetlabs-release-squeeze.deb 23-Apr-2013 12:36 3.4K
      [ ] puppetlabs-release-stable.deb 23-Apr-2013 12:36 3.3K
      [ ] puppetlabs-release-unstable.deb 23-Apr-2013 12:36 3.4K
      [ ] puppetlabs-release-wheezy.deb 23-Apr-2013 12:36 3.3K

      download the deb for your release.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s