machine_setup/ansible/run.bash

54 lines
2.4 KiB
Bash
Raw Normal View History

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 "${@}"
2024-01-01 02:29:38 +00:00
elif [ "$target" = "odowork" ]; then
ansible-playbook -v -i environments/laptop playbook.yaml --diff --limit odowork "${@}"
elif [ "$target" = "jail_nat_dhcp" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit nat_dhcp "${@}"
elif [ "$target" = "jail_homeserver_nat_dhcp" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit homeserver_nat_dhcp "${@}"
2024-07-01 03:02:23 +00:00
elif [ "$target" = "sftp" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit sftp "${@}"
2024-07-02 02:01:07 +00:00
elif [ "$target" = "certificate" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit certificate "${@}"
elif [ "$target" = "bastion" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit bastion "${@}"
2024-08-15 01:25:49 +00:00
elif [ "$target" = "momlaptop" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit momlaptop "${@}"
2022-12-10 22:55:44 +00:00
elif [ "$target" = "vm_poudriereodo" ]; then
ansible-playbook -v -i environments/vm playbook.yaml --diff --limit poudriereodo "${@}"
2023-05-29 04:13:57 +00:00
elif [ "$target" = "vm_poudrieremrmanager" ]; then
ansible-playbook -v -i environments/vm playbook.yaml --diff --limit poudrieremrmanager "${@}"
2023-05-28 03:10:44 +00:00
elif [ "$target" = "mrmanager" ]; then
ansible-playbook -v -i environments/colo playbook.yaml --diff --limit mrmanager "${@}"
elif [ "$target" = "jail_mrmanager_nat_dhcp" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit mrmanager_nat_dhcp "${@}"
elif [ "$target" = "jail_admin_git" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit admin_git "${@}"
2023-06-18 19:21:16 +00:00
elif [ "$target" = "jail_public_dns" ]; then
ansible-playbook -v -i environments/jail playbook.yaml --diff --limit public_dns "${@}"
2022-10-09 22:51:41 +00:00
else
die 1 "Unrecognized target"
fi