1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

XSCE -> IIAB

This commit is contained in:
Jerry Vonau 2017-10-24 11:39:49 -05:00
parent 0aedaa24fd
commit c606083553
5 changed files with 28 additions and 44 deletions

View file

@ -3,15 +3,17 @@
if [ -f /etc/iiab/iiab.env ]
then
. /etc/iiab/iiab.env
cd $XSCE_DIR
cd $IIAB_DIR
else
echo /etc/iiab/iiab.env is missing. Playbook has not been run.
exit 1
fi
CWD=`pwd`
if [ ! -f iiab-network.yml ]
then
echo "XSCE Playbook not found."
echo "IIAB Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit
@ -22,7 +24,7 @@ then
touch /etc/iiab/config_vars.yml
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-network.log"
export ANSIBLE_LOG_PATH="$CWD/iiab-network.log"
ansible-playbook -i ansible_hosts iiab-network.yml --connection=local
echo "" >> iiab-network.log
ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log

View file

@ -2,6 +2,7 @@
PLAYBOOK="iiab-base.yml"
INVENTORY="ansible_hosts"
CWD=`pwd`
if [ ! -f $PLAYBOOK ]
then
@ -14,5 +15,5 @@ fi
sed -i -e "s/openvpn_install: False/openvpn_install: True/" vars/local_vars.yml
sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" vars/local_vars.yml
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log"
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local

View file

@ -1,7 +1,7 @@
# This is a configuration file for XSCE
# It can sourced in a shell script or read into an application
XSCE_BASE_PATH={{ iiab_base }}
XSCE_DIR={{ iiab_dir }}
IIAB_BASE_PATH={{ iiab_base }}
IIAB_DIR={{ iiab_dir }}
OS={{ ansible_local.local_facts.os }}
OS_VER={{ ansible_local.local_facts.os_ver }}
WWWROOT={{ doc_root }}

View file

@ -1,4 +1,8 @@
#!/bin/bash -e
PLAYBOOK="iiab.yml"
INVENTORY="ansible_hosts"
# Pass cmdline options for ansible
ARGS="$@"
# copy var files to /etc/iiab for subsequent use
mkdir -p /etc/iiab
@ -28,13 +32,14 @@ fi
if [ -f /etc/iiab/iiab.env ]
then
. /etc/iiab/iiab.env
cd $XSCE_DIR
cd $IIAB_DIR
else
XSCE_DIR=/opt/iiab/iiab
IIAB_DIR=/opt/iiab/iiab
mkdir -p /etc/iiab
fi
CWD=`pwd`
if [ ! -f iiab.yml ]
if [ ! -f $PLAYBOOK ]
then
echo "IIAB Playbook not found."
echo "Please run this command from the top level of the git repo."
@ -47,34 +52,10 @@ if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then
fi
cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
PLAYBOOK="iiab.yml"
INVENTORY="ansible_hosts"
CWD=`pwd`
echo "Running local playbooks! "
XSDOMAIN=""
# Pass in Existing Domain
if [ -f /etc/sysconfig/xs_domain_name ]
then
XSDOMAIN=`cat /etc/sysconfig/xs_domain_name`
fi
# Or accept Domain on command line
if [ x"$1" != x ]
then
XSDOMAIN=$1
fi
# Pass in git location
if [ x"$XSDOMAIN" != x ]
then
ARGS="--extra-vars '{\"iiab_domain\":\"$XSDOMAIN\"}'"
else
ARGS=""
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log"
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local

20
runtags
View file

@ -1,20 +1,20 @@
#!/bin/bash
# copy var files to /etc/iiab for subsequent use
#./install-init
# if not the first run, repo location is here
PLAYBOOK="iiab.yml"
INVENTORY="ansible_hosts"
# Pass cmdline options for ansible
ARGS="$@"
if [ -f /etc/iiab/iiab.env ]
then
. /etc/iiab/iiab.env
cd $XSCE_DIR
cd $IIAB_DIR
fi
if [ ! -f iiab.yml ]
CWD=`pwd`
if [ ! -f $PLAYBOOK ]
then
echo "XSCE Playbook not found."
echo "IIAB Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit
@ -51,5 +51,5 @@ then
taglist="netvars,"$taglist
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log"
export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"
ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist"""