arch-install/run-macos.sh
Ariejan de Vroom 88cee262f7
Some checks failed
Lint / Lint (3.10) (push) Failing after 18s
Lint / Lint (3.11) (push) Failing after 21s
Tweaks for macos
2024-08-23 10:24:16 +02:00

31 lines
771 B
Bash
Executable File

#!/usr/bin/env -S bash -i
if [[ -z "${ANSIBLE_BECOME_PASS}" ]]; then
echo "ANSIBLE_BECOME_PASS is not set. Please configure your .env correctly. Exiting."
exit 1
fi
while getopts "h:" opt; do
case ${opt} in
h )
MACOS_HOSTNAME=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" 1>&2
exit 1
;;
: )
echo "Invalid option: -$OPTARG requires an argument" 1>&2
exit 1
;;
esac
done
if [[ -z "${MACOS_HOSTNAME}" ]]; then
echo "The -h option is required. Exiting."
exit 1
else
echo "Setting hostname to ${MACOS_HOSTNAME}"
fi
ansible-playbook macos.yml -e "ansible_become_pass=${ANSIBLE_BECOME_PASS} macos_hostname=${MACOS_HOSTNAME}"