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