-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-console
executable file
·51 lines (40 loc) · 1.04 KB
/
install-console
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
#!/bin/bash
# copy var files to /etc/xsce for subsequent use
#./install-init
# if not the first run, repo location is here
if [ -f /etc/xsce/xsce.env ]
then
. /etc/xsce/xsce.env
cd $XSCE_DIR
else
XSCE_DIR=/opt/schoolserver/xsce
mkdir -p /etc/xsce
touch /etc/xsce/config_vars.yml
fi
# don't track vars/local_vars.yml
git update-index --assume-unchanged vars/local_vars.yml
PLAYBOOK="xsce-base.yml"
INVENTORY="ansible_hosts"
SELINUX_BEFORE=""
SELINUX_AFTER=""
if [ ! -f $PLAYBOOK ]
then
echo "XSCE Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit 1
fi
if [ -f /etc/selinux/config ]
then
SELINUX_BEFORE=`cat /etc/selinux/config | gawk -F= '/^SELINUX=/{ print $2 }'`
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-install.log"
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
if [ -f /etc/selinux/config ]
then
SELINUX_AFTER=`cat /etc/selinux/config | gawk -F= '/^SELINUX=/{ print $2 }'`
fi
if [ "$SELINUX_BEFORE" != "$SELINUX_AFTER" ]; then
echo "Rebooting ..."
reboot
fi