mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
28 lines
571 B
Text
28 lines
571 B
Text
|
#!/bin/bash
|
||
|
|
||
|
INVENTORY=ansible_hosts
|
||
|
PLAYBOOK=run-roles-tmp.yml
|
||
|
|
||
|
CWD=`pwd`
|
||
|
if [ ! -f iiab-stages.yml ]; then
|
||
|
echo "Exiting: IIAB Playbook not found."
|
||
|
echo "Please run this in /opt/iiab/iiab (top level of the git repo)."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [[ $# -eq 0 ]] ; then
|
||
|
echo "Usage: ./runroles <list of roles separated by spaces>"
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
# make working playbook
|
||
|
cp runroles-base.yml $PLAYBOOK
|
||
|
|
||
|
# add desired roles from arguments
|
||
|
for role in "$@"
|
||
|
do
|
||
|
echo " - { role: $role }" >> $PLAYBOOK
|
||
|
done
|
||
|
|
||
|
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
|