1 # Puppet infrastructure
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).
7 To set up a new host to be a puppet client, do the following:
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
13 : __handel__ && puppet agent --no-daemonize --onetime --environment=production
15 : ::client:: && me=$(hostname -f) && [ "$me" != "${me%debian.org}" ] && apt-get update &&
16 apt-get install -y --no-install-recommends puppet ruby-augeas augeas-lenses lsb-release &&
17 service puppet stop &&
18 (puppet agent -t || true ) &&
19 cd /var/lib/puppet/ssl/certificate_requests &&
20 echo sha256sum output: && echo &&
24 This will not overwrite anything yet, since handel has not signed the
25 client cert. Now is the time to abort if you are getting cold feet.
27 Compare incoming csr request:
28 on handel, paste the sha256output::
31 ud-replicate && sudo -u puppet make -C /srv/puppet.debian.org/ca/ install &&
32 echo "paste sha256sum output now:" &&
33 read sha256 filename &&
34 cd /var/lib/puppet/ssl/ca/requests &&
35 ( [ -e $filename ] || (echo "$filename does not exist."; exit 1) ) &&
36 echo -e "$sha256 $filename" | sha256sum -c &&
37 puppet ca sign $(basename "$filename" .pem) &&
38 echo && echo && echo &&
39 echo 'cat > /var/lib/puppet/ssl/certs/ca.pem << EOF ' &&
40 cat /var/lib/puppet/ssl/certs/ca.pem &&
42 echo "cat > /var/lib/puppet/ssl/certs/$filename << EOF " &&
43 cat /var/lib/puppet/ssl/ca/signed/$filename &&
46 echo 'puppet agent --enable' &&
47 echo 'puppet agent -t --pluginsync' &&
48 echo 'puppet agent -t --pluginsync'
50 and execute this on the client.
52 : ::client:: copy paste the thing you just created on handel
54 If this is a busy mail host, you might want to stop exim before proceeding
55 although the config files should remain identical before and after.
57 Try this once if you're nervous:
59 : ::client:: && puppet agent -t --pluginsync --noop
61 It will tell you what would have changed without actually doing it.
63 Then run (this will change the configs in /etc):
65 : ::client:: && puppet agent -t --pluginsync
67 This run will start puppet after reconfiguring it, so if you are
68 unhappy with what just happened, you'll need to stop it again to do
71 Double check apt - the puppet setup usually results in duplicate apt
72 sources, since we ship a few under sources.list.d. Remove any unnecessary
73 entries from sources.list.
75 On handel, make sure the certs exist for the new host
78 We ship a samhain config file that includes /lib and /usr/lib. This will
79 almost certainly be different than the config file on the machine, so it
80 will result in 1000s of files changed.
81 You may need to run samhain update after getting puppet going.
83 The puppet repository is public, but we sometimes need to keep passwords
84 in puppet. There are many ways to do this - hiera-gpg, ENC, etc. We've
85 settled on a fairly simple one. Log into handel, create a new manifest
86 in the relevant module (call is something like "params.pp"). You can add
87 passwords to this file. To stop git complaining on push, make sure you
88 update .gitignore for the new file. Now you can import this file where
89 you need passwords and use them.