1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00
iiab/install-console

52 lines
1 KiB
Text
Raw Normal View History

2017-05-27 18:09:50 +00:00
#!/bin/bash
# copy var files to /etc/iiab for subsequent use
2017-05-27 18:09:50 +00:00
#./install-init
# if not the first run, repo location is here
if [ -f /etc/iiab/iiab.env ]
2017-05-27 18:09:50 +00:00
then
. /etc/iiab/iiab.env
2017-05-27 18:09:50 +00:00
cd $XSCE_DIR
else
XSCE_DIR=/opt/schoolserver/iiab
mkdir -p /etc/iiab
touch /etc/iiab/config_vars.yml
2017-05-27 18:09:50 +00:00
fi
# don't track vars/local_vars.yml
git update-index --assume-unchanged vars/local_vars.yml
PLAYBOOK="iiab-base.yml"
2017-05-27 18:09:50 +00:00
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/iiab-install.log"
2017-05-27 18:09:50 +00:00
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