2022-10-09 22:51:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Run ansible
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
cd "$DIR"
|
|
|
|
|
|
|
|
function die {
|
|
|
|
code="$1"
|
|
|
|
shift 1
|
|
|
|
(>&2 echo "${@}")
|
|
|
|
exit "$code"
|
|
|
|
}
|
|
|
|
|
|
|
|
target="$1"
|
|
|
|
shift 1
|
|
|
|
|
|
|
|
if [ "$target" = "homeserver" ]; then
|
|
|
|
ansible-playbook -v -i environments/home playbook.yaml --diff --limit homeserver "${@}"
|
2022-10-11 01:50:39 +00:00
|
|
|
elif [ "$target" = "odolinux" ]; then
|
|
|
|
ansible-playbook -v -i environments/laptop playbook.yaml --diff --limit odolinux "${@}"
|
2022-10-15 04:54:11 +00:00
|
|
|
elif [ "$target" = "odofreebsd" ]; then
|
|
|
|
ansible-playbook -v -i environments/laptop playbook.yaml --diff --limit odofreebsd "${@}"
|
2022-12-03 01:39:52 +00:00
|
|
|
elif [ "$target" = "jail_nat_dhcp" ]; then
|
|
|
|
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit nat_dhcp "${@}"
|
2022-12-03 06:41:00 +00:00
|
|
|
elif [ "$target" = "jail_homeserver_nat_dhcp" ]; then
|
|
|
|
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit homeserver_nat_dhcp "${@}"
|
2022-12-10 22:55:44 +00:00
|
|
|
elif [ "$target" = "vm_poudriereodo" ]; then
|
|
|
|
ansible-playbook -v -i environments/vm playbook.yaml --diff --limit poudriereodo "${@}"
|
2022-10-09 22:51:41 +00:00
|
|
|
else
|
|
|
|
die 1 "Unrecognized target"
|
|
|
|
fi
|