try with different line spacing
[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 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 Finally, for some reason, the switch to puppet seems to heavily confuse
55 samhain (possibly the config file getting changed out from under it?).
56 You may need to run samhain update after getting puppet going.
57
58 When you're happy with everything, add teh new host to the puppet
59 hostgroup in dsa-nagios.