mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
55 lines
1.1 KiB
Bash
Executable file
55 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# copy var files to /etc/iiab for subsequent use
|
|
|
|
#./install-init
|
|
|
|
# if not the first run, repo location is here
|
|
|
|
if [ -f /etc/iiab/iiab.env ]
|
|
then
|
|
. /etc/iiab/iiab.env
|
|
cd $XSCE_DIR
|
|
fi
|
|
|
|
if [ ! -f iiab.yml ]
|
|
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")
|
|
|
|
if [ "$tags" == "" ]
|
|
then
|
|
echo " usage: ./runtags <tagname>"
|
|
echo " usage: ./runtags <tagname1>,<tagname2>,<tagname3>"
|
|
echo " Can take a single value or a comma-separated list (no spaces within the list!)"
|
|
echo " Now retrieving a list of possible Ansible playbook and tagname values..."
|
|
ansible-playbook -i ansible_hosts iiab.yml --connection=local --list-tag
|
|
exit 0
|
|
fi
|
|
|
|
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
|
|
|
|
export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log"
|
|
ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist"""
|