File: server-install

package info (click to toggle)
freeipa 4.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 367,240 kB
  • sloc: javascript: 562,763; python: 310,289; ansic: 49,809; sh: 7,176; makefile: 2,589; xml: 343; sed: 16
file content (57 lines) | stat: -rw-r--r-- 1,636 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

export KRB5_TRACE=/dev/stderr

# hack for lxc
IP=`ip route get 1.1.1.1 | sed -n -e's/.*src //; s/ .*//; p; q'`
echo "IP address is $IP"

HOSTNAME=`cat /etc/hosts| grep '127.0.1.1' | awk '{print $NF; exit}' | sed 's/\..*//'`
echo "Hostname was: $HOSTNAME"

if [ -z $HOSTNAME ]; then
    HOSTNAME=autopkgtest
    hostname $HOSTNAME
    echo $HOSTNAME > /etc/hostname
fi

echo "$IP $HOSTNAME.debci.ipatest $HOSTNAME" >> /etc/hosts

echo "/etc/hosts now has:"
cat /etc/hosts

if [ ! -d /etc/systemd/system/pki-tomcatd.target.wants ]; then
    echo "WHOOPS: Creating /etc/systemd/system/pki-tomcatd.target.wants"
    mkdir /etc/systemd/system/pki-tomcatd.target.wants
fi
if [ ! -d /etc/systemd/system/pki-tomcatd-nuxwdog.target.wants ]; then
    echo "WHOOPS: Creating /etc/systemd/system/pki-tomcatd-nuxwdog.target.wants"
    mkdir /etc/systemd/system/pki-tomcatd-nuxwdog.target.wants
fi

ipa-server-install \
	-U \
	-r DEBCI.IPATEST \
	-n debci.ipatest \
	-p Secret123 \
	-a Secret123 \
	--ip-address=$IP \
	--setup-dns \
	--no-forwarders \
	--hostname=$HOSTNAME.debci.ipatest

if [ $? != 0 ]; then
    echo ">>>>> journalctl named >>>>>>>"
    journalctl -xeu named.service
    echo ">>>>> journalctl certmonger >>>>>>>"
    journalctl -xeu certmonger.service
    echo ">>>>> journalctl apache2 >>>>>>>"
    journalctl -xeu apache2.service
    echo ">>>>> journalctl pki-tomcatd >>>>>>>"
    journalctl -xeu pki-tomcatd@pki-tomcat.service
    echo ">>>>> IPASERVER log >>>>>>>"
    tail -n 2000 /var/log/ipaserver-install.log
    echo ">>>>> IPACLIENT log >>>>>>>"
    tail -n 2000 /var/log/ipaclient-install.log
    exit 1
fi