25b7c493af6e230fc861d6d53d45778cb68736af
[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         : ::client:: && apt-get install --no-install-recommends puppet &&
10                 /etc/init.d/puppet stop &&
11                 puppetd -w 5 --debug -t --factsync
12
13 This will not overwrite anything yet, since handel has not signed the
14 client cert.  Now is the time to abort if you are getting cold feet.
15
16 Compare incoming csr request:
17 on handel:
18
19         : __handel__ && echo -n 'Client name: ' && read client &&
20                 sha1sum /var/lib/puppet/ssl/ca/requests/$client.debian.org.pem
21 on new client:
22
23         : ::client:: && sha1sum /var/lib/puppet/ssl/csr_$(hostname).debian.org.pem
24
25 If you're satisfied, sign the request on handel with:
26
27         : __handel__ && puppetca --sign $client.debian.org
28
29 bootstrap client knowledge of puppet ca:
30 on handel:
31
32         : __handel__ && echo 'cat > /var/lib/puppet/ssl/certs/ca.pem << EOF ' &&
33                 cat /var/lib/puppet/ssl/certs/ca.pem &&
34                 echo 'EOF' &&
35                 echo "cat > /var/lib/puppet/ssl/certs/$client.debian.org.pem << EOF " &&
36                 cat /var/lib/puppet/ssl/ca/signed/$client.debian.org.pem &&
37                 echo 'EOF'
38
39 and execute this on the client.
40
41         : ::client:: copy paste the thing you just created on handel
42
43 If this is a busy mail host, you might want to stop exim before proceeding
44 although the config files should remain identical before and after.
45
46 Then run (this will change the configs in /etc):
47
48         : ::client:: && puppetd -w 5 --debug -t --factsync
49
50 This run will start puppet after reconfiguring it, so if you are 
51 unhappy with what just happened, you'll need to stop it again to do 
52 repair.
53
54 Double check apt - the puppet setup usually results in duplicate apt
55 sources, since we ship a few under sources.list.d.  Remove any unnecessary
56 entries from sources.list.
57
58 We ship a samhain config file that includes /lib and /usr/lib.  This will
59 almost certainly be different than the config file on the machine, so it
60 will result in 1000s of files changed.
61 You may need to run samhain update after getting puppet going.