mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
commit
4c8cc36ba8
3 changed files with 24 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
||||||
# This is a configuration file for IIAB
|
# This is a configuration file for IIAB
|
||||||
# It can sourced in a shell script or read into an application
|
# It can be sourced in a shell script or read into an application
|
||||||
IIAB_BASE_PATH={{ iiab_base }}
|
IIAB_BASE_PATH={{ iiab_base }}
|
||||||
IIAB_DIR={{ iiab_dir }}
|
IIAB_DIR={{ iiab_dir }}
|
||||||
IIAB_RELEASE={{ iiab_base_ver }}
|
IIAB_RELEASE={{ iiab_base_ver }}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
BindTo=%i.device
|
BindTo=%i.device
|
||||||
After=%i.device
|
After=%i.device
|
||||||
|
After=rc-local.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|
48
runtags
48
runtags
|
@ -1,19 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# running from a git repo
|
|
||||||
PLAYBOOK="iiab.yml"
|
|
||||||
INVENTORY="ansible_hosts"
|
INVENTORY="ansible_hosts"
|
||||||
|
PLAYBOOK="iiab.yml"
|
||||||
|
#PLAYBOOK="iiab-stages.yml"
|
||||||
CWD=`pwd`
|
CWD=`pwd`
|
||||||
|
|
||||||
export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"
|
export ANSIBLE_LOG_PATH="$CWD/iiab-debug.log"
|
||||||
|
|
||||||
if [ ! -f $PLAYBOOK ]
|
if [ ! -f $PLAYBOOK ]; then
|
||||||
then
|
echo "Exiting: IIAB Playbook not found."
|
||||||
echo "IIAB Playbook not found."
|
echo "Please run this in /opt/iiab/iiab (top level of the git repo)."
|
||||||
echo "Please run this command from the top level of the git repo."
|
exit 1
|
||||||
echo "Exiting."
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Is the following stanza nec?
|
||||||
if [ ! -f /etc/iiab/config_vars.yml ]; then
|
if [ ! -f /etc/iiab/config_vars.yml ]; then
|
||||||
mkdir -p /etc/iiab
|
mkdir -p /etc/iiab
|
||||||
echo "{}" > /etc/iiab/config_vars.yml
|
echo "{}" > /etc/iiab/config_vars.yml
|
||||||
|
@ -21,31 +21,27 @@ fi
|
||||||
|
|
||||||
tags=$(echo $1 | tr "," "\n")
|
tags=$(echo $1 | tr "," "\n")
|
||||||
|
|
||||||
if [ "$tags" == "" ]
|
if [ "$tags" == "" ]; then
|
||||||
then
|
echo " usage: ./runtags <tagname>"
|
||||||
echo " usage: ./runtags <tagname>"
|
echo " usage: ./runtags <tagname1>,<tagname2>,<tagname3>"
|
||||||
echo " usage: ./runtags <tagname1>,<tagname2>,<tagname3>"
|
echo " Can take a single value or a comma-separated list (no spaces within the list!)"
|
||||||
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..."
|
||||||
echo " Now retrieving a list of possible Ansible playbook and tagname values..."
|
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local --list-tags
|
||||||
ansible-playbook -i ansible_hosts iiab.yml --connection=local --list-tag
|
exit 0
|
||||||
exit 0
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
found="N"
|
found="N"
|
||||||
|
|
||||||
for tag in $tags
|
for tag in $tags; do
|
||||||
do
|
if [ "$tag" == "0-init" ]; then
|
||||||
if [ "$tag" == "0-init" ]
|
found="Y"
|
||||||
then
|
fi
|
||||||
found="Y"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
taglist=$1
|
taglist=$1
|
||||||
|
|
||||||
if [ "$found" == "N" ]
|
if [ "$found" == "N" ]; then
|
||||||
then
|
taglist="0-init,"$taglist
|
||||||
taglist="0-init,"$taglist
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist"""
|
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local --tags=$taglist
|
||||||
|
|
Loading…
Reference in a new issue