start of changes
[mirror/dsa-wiki.git] / input / howto / new-machine.creole
1 = how to add a new machine =
2
3 Note: this has recently been changed to rely more on [[puppet|howto/puppet-setup]].  If stuff breaks fix it.
4
5
6 * some initial stuff:
7 {{{
8     apt-get install --no-install-recommends ssh vim &&
9     echo -n > /etc/environment &&
10     echo -n > /etc/default/locale &&
11     apt-get install --no-install-recommends dialog && &&
12     echo "debconf debconf/priority        select high" | debconf-set-selections &&
13     echo "debconf debconf/frontend        select Dialog" | debconf-set-selections
14 }}}
15
16 * unless we want to keep it:
17 {{{
18     dpkg -l postfix | grep '^ii  postfix' && (dpkg --purge postfix && rm /etc/aliases)
19 }}}
20
21 * on draghi, add the host to the ldap using ud-host.  Set the ssh key and the IP Address attributes.
22
23 * run generate, or wait until cron runs it for you.  Update DNS.
24 {{{
25     : :: draghi :: && sudo -u sshdist ud-generate && sudo -H ud-replicate && sudo -H puppetd -t
26     : :: orff :: && sudo -H ud-replicate
27 }}}
28
29 * setup [[puppet|howto/puppet-setup]]  (run the puppet client two or three times until things converge.)
30
31 * on the host, run ud-replicate
32 {{{
33     echo draghi.debian.org,draghi,db.debian.org,db,82.195.75.106,::ffff:82.195.75.106,2001:41b8:202:deb:1a1a:0:52c3:4b6a ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAy1mAS0xIOZH9OrJZf1Wv9qYORv5Z5fmpF0o8Y4IMdS+ZzTjN1Sl8M77jaFTJbumJNs+n2CMcX8CoMemQEPBoRe20a5t3dExPQ3c7FNU0z+WIVFbu/oTTkAWGp5gCDwF3pg2QxUjqYc0X4jpv6pkisyvisij6V/VJ5G1hsIMuKqrCKYyyyiJJytfzSfRrBx2QvB5ZWQxhYeSYDoLDvuF31qUy4TLZ/HR3qZQ1cBrP9dCh5d+GQxdY9LuO6zjlnSyU64GHkyjYt3p03AKG4plD7WHX01bD0DQQ/NOFVwFhOZ63mePyridPuqBMFW39jBf4jSsewV95RE5VbY04+MY4XQ== root@draghi >> /etc/ssh/ssh_known_hosts &&
34     ud-replicate
35 }}}
36
37 * check if it worked:
38 {{{
39     id weasel
40 }}}
41
42 * install debian.org which brings you shells and much other fun
43 {{{
44     apt-get install -y debian.org debian.org-recommended
45 }}}
46
47 * run puppet a couple times
48 {{{
49     puppet agent -t; puppet agent -t; puppet agent -t; puppet agent -t
50 }}}
51
52 * try to login using your user and ssh key.  you should get a homedir.
53
54 * try to become root using sudo.
55
56 * make ca-certificates sane:  (choose to *not* trust new certs, and we only want the spi cert activated)
57 {{{
58     echo "ca-certificates ca-certificates/trust_new_crts  select no" | debconf-set-selections
59     sed -i -e 's/^[^#!].*/!&/; s#^!spi-inc.org/spi-cacert-2008.crt#spi-inc.org/spi-cacert-2008.crt#' /etc/ca-certificates.conf
60     dpkg-reconfigure ca-certificates
61 }}}
62
63 * Add debian-admin@debian.org to root in /etc/aliases
64 {{{
65   if ! egrep '^root:' /etc/aliases > /dev/null; then
66     echo "root: debian-admin@debian.org" >> /etc/aliases
67   elif ! egrep '^root:.*debian-admin@debian.org' /etc/aliases > /dev/null; then
68     sed -i -e 's/^root: .*/&, debian-admin@debian.org/' /etc/aliases
69   fi
70   newaliases
71 }}}
72
73 * install samhain and get puppet to configure it
74 {{{
75   apt-get install -y samhain &&
76   ( puppet agent -t || true ) &&
77   service samhain stop &&
78   rm /var/state/samhain/samhain_file &&
79   samhain --foreground -t init -p none -s none -l none -m none &&
80   service samhain start
81 }}}
82
83 * if it is a HP Proliant, or has other management fu, read [[howto/ilo-https]]
84
85 * edit dedication into in $DSA-PUPPET/modules/debian-org/misc/local.yaml
86
87 * add to nagios
88
89 -- weasel, Wed, 04 Jun 2008 20:52:56 +0200