Fix afs cache size
[hcoop/zz_old/machine-template.git] / navajos-postinstall.sh
1 #!/bin/bash
2
3 # Run on newly created node as a kerberos/afs admin with local sudo rights
4
5 set -e
6 set -v
7 set -x
8
9 # Misc postinst stuff
10 # Unfortunately has to be run after the first reboot by an admin user
11
12 sudo apt-get install hcoop-admin-common-config
13
14 # Extract host keytab
15 sudo kadmin -p ${USER}@HCOOP.NET -r HCOOP.NET -q "ktadd -k /etc/krb5.keytab host/navajos.hcoop.net@HCOOP.NET"
16 sudo chown root:root /etc/krb5.keytab
17 sudo chmod go-rwx /etc/krb5.keytab
18
19 # Sync initial set of keytabs
20 sudo mkdir -p /etc/keytabs
21
22 (ssh fritz.hcoop.net cd /etc/keytabs \; sudo tar clpf - . | \
23 (cd /etc/keytabs; sudo tar xlpf -))
24
25 # deploy domtool locally
26 sudo touch /var/log/domtool.log
27 sudo chown domtool:nogroup /var/log/domtool.log
28 sudo chmod 600 /var/log/domtool.log
29
30 sudo mkdir -p /var/domtool
31 sudo chown domtool:nogroup /var/domtool
32 sudo chmod 755 /var/domtool
33
34 sudo mkdir -p /var/log/apache2
35 sudo mkdir -p /var/log/apache2/user
36 sudo chown domtool:nogroup /var/log/apache2/user
37 sudo chmod 755 /var/log/apache2/user
38
39 sudo -u domtool mkdir -p /var/domtool/vhosts
40 sudo -u domtool touch /var/domtool/local_domains.cfg
41 sudo -u domtool mkdir -p /var/domtool/firewall
42
43 # FIXME: move this script to the common scripts volume
44 ~clinton_admin/deploy-domtool-on-host.sh --slave --bootstrap
45
46 # Basic Packages Needed for Web Serving
47 sudo apt-get install apache2-mpm-prefork hcoop-apache2-config
48
49 echo "Manually run 'domtool-admin regen' if needed"