install lsb-release, puppetd on the client will not start without it
[mirror/dsa-wiki.git] / input / howto / puppet-setup.mdwn
1 # Puppet infrastructure
2
3 handel.debian.org is our current puppetmaster.  Currently, it handles
4 configuration of samhain, munin, apt, and exim (although more to come -
5 this list is likely to get out of date quickly).
6
7 To set up a new host to be a puppet client, do the following:
8
9 Make sure you have set up the IP address for the new machine in ud-ldap.
10 After that run puppet on puppetmaster once, so the ferm config get
11 adjusted.
12
13         : __handel__ && puppetd -t --environment=production
14
15         : ::client:: && apt-get update &&
16                 apt-get install --no-install-recommends puppet libaugeas-ruby1.8 augeas-lenses lsb-release &&
17                 /etc/init.d/puppet stop &&
18                 puppetd -w 5 -t
19
20 This will not overwrite anything yet, since handel has not signed the
21 client cert.  Now is the time to abort if you are getting cold feet.
22
23 Compare incoming csr request:
24 on handel:
25
26         : __handel__ && echo -n 'Client name: ' && read client &&
27                 sha1sum /var/lib/puppet/ssl/ca/requests/$client.debian.org.pem
28 on new client:
29
30         : ::client:: && sha1sum /var/lib/puppet/ssl/certificate_requests/$(hostname).debian.org.pem
31
32 If you're satisfied, sign the request on handel with:
33
34         : __handel__ && puppetca --sign $client.debian.org
35
36 bootstrap client knowledge of puppet ca:
37 on handel:
38
39         : __handel__ && echo 'cat > /var/lib/puppet/ssl/certs/ca.pem << EOF ' &&
40                 cat /var/lib/puppet/ssl/certs/ca.pem &&
41                 echo 'EOF' &&
42                 echo "cat > /var/lib/puppet/ssl/certs/$client.debian.org.pem << EOF " &&
43                 cat /var/lib/puppet/ssl/ca/signed/$client.debian.org.pem &&
44                 echo 'EOF'
45
46 and execute this on the client.
47
48         : ::client:: copy paste the thing you just created on handel
49
50 If this is a busy mail host, you might want to stop exim before proceeding
51 although the config files should remain identical before and after.
52
53 Then run (this will change the configs in /etc):
54
55         : ::client:: && puppetd -w 5 --debug -t
56
57 This run will start puppet after reconfiguring it, so if you are 
58 unhappy with what just happened, you'll need to stop it again to do 
59 repair.
60
61 Double check apt - the puppet setup usually results in duplicate apt
62 sources, since we ship a few under sources.list.d.  Remove any unnecessary
63 entries from sources.list.
64
65 We ship a samhain config file that includes /lib and /usr/lib.  This will
66 almost certainly be different than the config file on the machine, so it
67 will result in 1000s of files changed.
68 You may need to run samhain update after getting puppet going.
69
70 # vim:textwidth=72 sw=8 ts=8 et