Correct path to local.yaml within the puppet repository
[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 puppet agent --no-daemonize --onetime
26     : :: denis :: && 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 and check if it worked
32 {{{
33     apt-get update &&
34     apt-get install -y --no-install-recommends userdir-ldap &&
35     ud-replicate &&
36     id weasel
37 }}}
38
39 * install debian.org which brings you shells and much other fun
40 {{{
41     apt-get install -y debian.org debian.org-recommended
42 }}}
43
44 * run puppet a couple times
45 {{{
46     puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime; puppet agent --no-daemonize --onetime
47 }}}
48
49 * install security updates etc.
50 {{{
51     apt-get update && apt-get dist-upgrade && apt-get clean
52 }}}
53
54 * try to login using your user and ssh key.  you should get a homedir.
55
56 * try to become root using sudo.
57
58 * Add debian-admin@debian.org to root in /etc/aliases
59 {{{
60   if ! egrep '^root:' /etc/aliases > /dev/null; then
61     echo "root: debian-admin@debian.org" >> /etc/aliases
62   elif ! egrep '^root:.*debian-admin@debian.org' /etc/aliases > /dev/null; then
63     sed -i -e 's/^root: .*/&, debian-admin@debian.org/' /etc/aliases
64   fi
65   newaliases
66 }}}
67
68 * install samhain and get puppet to configure it
69 {{{
70   apt-get install -y samhain &&
71   ( puppet agent --no-daemonize --onetime || true ) &&
72   service samhain stop &&
73   rm -f /var/state/samhain/samhain_file /var/lib/samhain/samhain_file &&
74   samhain --foreground -t init -p none -s none -l none -m none &&
75   service samhain start
76 }}}
77
78 * if it is a HP Proliant, or has other management fu, read [[howto/ilo-https]]
79
80 * edit dedication into in $DSA-PUPPET/modules/debian_org/files/misc/local.yaml
81
82 * add to nagios
83
84 -- weasel, Wed, 04 Jun 2008 20:52:56 +0200