summaryrefslogtreecommitdiff
path: root/vm-install.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-12-08 16:53:43 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-12-08 16:53:43 +0100
commitee42cc8340f26be2316120a1434c5289d5927da2 (patch)
tree638ec7b167869c730fd7398a35118c330644276e /vm-install.sh
parentstrip old and not yet used hosts (diff)
improve handling of environment groups
Diffstat (limited to 'vm-install.sh')
-rwxr-xr-xvm-install.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/vm-install.sh b/vm-install.sh
index 0cc0be48..8d2bc665 100755
--- a/vm-install.sh
+++ b/vm-install.sh
@@ -4,7 +4,6 @@ if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
echo "$0 <vm> <distro> <codename>"
exit 1
fi
-
name=$1
shift
distro=$1
@@ -12,7 +11,13 @@ shift
codename=$1
shift
-echo "installing vm: $name with $distro/$codename"
+source "${BASH_SOURCE%/*}/common/utils.sh"
+get_ansible_variable env_group "$name"
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+
+echo "installing vm: $name with $distro/$codename in environment '$env_group'"
echo ""
echo "########## clearing old ssh host keys #########"
@@ -20,4 +25,4 @@ echo "########## clearing old ssh host keys #########"
echo ""
echo "######## running the install playbook ########"
-exec ansible-playbook -e "vmname=$name" -e "vmdistro=$distro" -e "vmdistcodename=$codename" $@ vm-install.yml
+exec ansible-playbook -e "vmname=$name" -e "vmdistro=$distro" -e "vmdistcodename=$codename" $@ "$env_group/vm-install.yml"