2017-05-27 18:09:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-06-09 23:25:56 +00:00
|
|
|
# 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
|
|
|
|
|
2017-06-09 23:25:56 +00:00
|
|
|
if [ -f /etc/iiab/iiab.env ]
|
2017-05-27 18:09:50 +00:00
|
|
|
then
|
2017-06-09 23:25:56 +00:00
|
|
|
. /etc/iiab/iiab.env
|
2017-05-27 18:09:50 +00:00
|
|
|
cd $XSCE_DIR
|
|
|
|
fi
|
|
|
|
|
2017-06-09 23:25:56 +00:00
|
|
|
if [ ! -f iiab.yml ]
|
2017-05-27 18:09:50 +00:00
|
|
|
then
|
|
|
|
echo "XSCE Playbook not found."
|
|
|
|
echo "Please run this command from the top level of the git repo."
|
|
|
|
echo "Exiting."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
tags=$(echo $1 | tr "," "\n")
|
|
|
|
|
|
|
|
found="N"
|
|
|
|
|
|
|
|
for tag in $tags
|
|
|
|
do
|
|
|
|
if [ "$tag" == "prep" ]
|
|
|
|
then
|
|
|
|
found="Y"
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
# echo $found
|
|
|
|
|
|
|
|
taglist=$1
|
|
|
|
|
|
|
|
if [ "$found" == "N" ]
|
|
|
|
then
|
|
|
|
taglist="prep,"$taglist
|
|
|
|
fi
|
|
|
|
|
|
|
|
# script to run a specific tag in the current playbook
|
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
echo "usage: $0 <tagname>"
|
|
|
|
echo
|
|
|
|
echo " If you would like a list of possible values, enter $0 XXX"
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-06-09 23:25:56 +00:00
|
|
|
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log"
|
|
|
|
ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist"""
|