summaryrefslogtreecommitdiff
path: root/vm-install.sh
blob: 0cc0be480ffdeacc82ccafea1838202c7c465ecb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
  echo "$0 <vm> <distro> <codename>"
  exit 1
fi

name=$1
shift
distro=$1
shift
codename=$1
shift

echo "installing vm: $name with $distro/$codename"
echo ""

echo "########## clearing old ssh host keys #########"
./remove-known-host.sh "$name"
echo ""

echo "######## running the install playbook ########"
exec ansible-playbook -e "vmname=$name" -e "vmdistro=$distro" -e "vmdistcodename=$codename" $@ vm-install.yml