summaryrefslogtreecommitdiff
path: root/upgrade.sh
blob: fa59b1ebb98e286e63674453a1f8bf960eb79c90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

if [ -z "$1" ]; then
  echo "$0 <host(s)>"
  exit 1
fi
hosts="$1"
shift

cd "${BASH_SOURCE%/*}"
source common/utils.sh
ansible_variable__get env_group "$hosts" || exit 1
vault_environment__set "$env_group" || exit 1

echo "######## upgrading host(s) '$hosts' in environment '$env_group' ########"
exec ansible-playbook -e "myhosts=$hosts" -e "myrole=upgrade" $@ "$env_group/generic.yml"