keycloak-scim/.github/scripts/ansible/aws_ec2.sh
Ryan Emerson 74caf48b63
AuroraDB IT - Error creating EC2 runner instance
Closes #33874

- Use venv to install python dependencies
- Utilise latest ansible version
- Utilise RHEL 9 image to update python versions

Signed-off-by: Ryan Emerson <remerson@redhat.com>
2024-10-15 18:43:37 +02:00

26 lines
662 B
Bash
Executable file

#!/usr/bin/env bash
set -e
cd $(dirname "${BASH_SOURCE[0]}")
if [[ "$RUNNER_DEBUG" == "1" ]]; then
set -x
fi
OPERATION=$1
REGION=$2
CLUSTER_NAME=$3
case $OPERATION in
requirements)
ansible-galaxy collection install -r requirements.yml
pip3 install ansible boto3 botocore
;;
create|delete|start|stop)
if [ -f "env.yml" ]; then ANSIBLE_CUSTOM_VARS_ARG="-e @env.yml"; fi
ansible-playbook aws_ec2.yml -v -e "region=$REGION" -e "operation=$OPERATION" -e "cluster_name=$CLUSTER_NAME" $ANSIBLE_CUSTOM_VARS_ARG "${@:4}"
;;
*)
echo "Invalid option!"
echo "Available operations: requirements, create, delete, start, stop."
;;
esac