2017-12-16 22:56:14 +01:00
|
|
|
#!/bin/bash
|
2017-12-16 22:45:14 +01:00
|
|
|
|
|
|
|
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
|
|
|
|
|
|
|
if [[ ! -f /usr/bin/ansible ]]
|
|
|
|
then
|
2017-12-17 00:17:46 +01:00
|
|
|
echo "Please install ansible"
|
|
|
|
exit 1
|
2017-12-16 22:45:14 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z ${1+x} ]]
|
|
|
|
then
|
|
|
|
echo "Please choose a tag to install as param:"
|
|
|
|
ansible-playbook -i "localhost," -c local install.yml --list-tags
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-12-19 01:08:41 +01:00
|
|
|
echo "### LIST TASKS #################################################################"
|
2017-12-16 23:43:37 +01:00
|
|
|
|
2017-12-19 01:08:41 +01:00
|
|
|
ansible-playbook -i "localhost," -c local install.yml --list-tasks -t desktop | grep TAGS | egrep -v 'play|debug|include_role' | sed 's/\ *\(.*\)TAGS.*$/\1/'
|
|
|
|
|
2017-12-19 13:00:46 +01:00
|
|
|
echo "Do you want to dryrun ? (y/N)"
|
2017-12-19 01:08:41 +01:00
|
|
|
read ok
|
2017-12-19 13:00:46 +01:00
|
|
|
ok=${ok:-N}
|
2017-12-19 01:08:41 +01:00
|
|
|
|
2017-12-19 13:00:46 +01:00
|
|
|
if [[ "$ok" == "y" ]]
|
2017-12-19 01:08:41 +01:00
|
|
|
then
|
|
|
|
echo "### DRYRUN ###################################################################"
|
|
|
|
ansible-playbook -i "localhost," -c local install.yml --ask-become-pass -CD -t $1
|
|
|
|
fi
|
2017-12-16 23:43:37 +01:00
|
|
|
|
2017-12-17 21:09:47 +01:00
|
|
|
echo "Do you want to install ? (Y/n)"
|
2017-12-17 00:01:59 +01:00
|
|
|
read ok
|
2017-12-17 21:09:47 +01:00
|
|
|
ok=${ok:-Y}
|
|
|
|
|
|
|
|
if [[ "$ok" == "Y" ]]
|
2017-12-17 00:01:59 +01:00
|
|
|
then
|
|
|
|
echo "### RUN ####################################################################"
|
|
|
|
ansible-playbook -i "localhost," -c local install.yml --ask-become-pass -t $1
|
|
|
|
fi
|