1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +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 ] if [ -f /etc/iiab/iiab.env ]
then then
. /etc/iiab/iiab.env . /etc/iiab/iiab.env
cd $XSCE_DIR cd $IIAB_DIR
else else
echo /etc/iiab/iiab.env is missing. Playbook has not been run. echo /etc/iiab/iiab.env is missing. Playbook has not been run.
exit 1 exit 1
fi fi
CWD=`pwd`
if [ ! -f iiab-network.yml ] if [ ! -f iiab-network.yml ]
then 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 "Please run this command from the top level of the git repo."
echo "Exiting." echo "Exiting."
exit exit
@ -22,7 +24,7 @@ then
touch /etc/iiab/config_vars.yml touch /etc/iiab/config_vars.yml
fi 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 ansible-playbook -i ansible_hosts iiab-network.yml --connection=local
echo "" >> iiab-network.log echo "" >> iiab-network.log
ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log

View file

@ -2,6 +2,7 @@
PLAYBOOK="iiab-base.yml" PLAYBOOK="iiab-base.yml"
INVENTORY="ansible_hosts" INVENTORY="ansible_hosts"
CWD=`pwd`
if [ ! -f $PLAYBOOK ] if [ ! -f $PLAYBOOK ]
then 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_install: False/openvpn_install: True/" vars/local_vars.yml
sed -i -e "s/openvpn_enabled: False/openvpn_enabled: 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 ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local

View file

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

View file

@ -1,4 +1,8 @@
#!/bin/bash -e #!/bin/bash -e
PLAYBOOK="iiab.yml"
INVENTORY="ansible_hosts"
# Pass cmdline options for ansible
ARGS="$@"
# copy var files to /etc/iiab for subsequent use # copy var files to /etc/iiab for subsequent use
mkdir -p /etc/iiab mkdir -p /etc/iiab
@ -28,13 +32,14 @@ fi
if [ -f /etc/iiab/iiab.env ] if [ -f /etc/iiab/iiab.env ]
then then
. /etc/iiab/iiab.env . /etc/iiab/iiab.env
cd $XSCE_DIR cd $IIAB_DIR
else else
XSCE_DIR=/opt/iiab/iiab IIAB_DIR=/opt/iiab/iiab
mkdir -p /etc/iiab mkdir -p /etc/iiab
fi fi
CWD=`pwd`
if [ ! -f iiab.yml ] if [ ! -f $PLAYBOOK ]
then then
echo "IIAB Playbook not found." echo "IIAB Playbook not found."
echo "Please run this command from the top level of the git repo." 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 fi
cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact cp ./scripts/local_facts.fact /etc/ansible/facts.d/local_facts.fact
PLAYBOOK="iiab.yml"
INVENTORY="ansible_hosts"
CWD=`pwd`
echo "Running local playbooks! " echo "Running local playbooks! "
XSDOMAIN=""
# Pass in Existing Domain export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
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"
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local

20
runtags
View file

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