This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
molecule/ec2-entrypoint.sh
Robert Kaussow 549f38c317
All checks were successful
continuous-integration/drone/push Build is passing
run ansible-galaxy if requirements file is present
2019-05-19 21:53:19 +02:00

23 lines
634 B
Bash
Executable File

#!/usr/bin/env bash
set -o pipefail
set -o errtrace
set -o nounset
set -o errexit
ANSIBLE_ROLES_PATH=${ANSIBLE_ROLES_PATH:-/drone/src}
MOLECULE_REQUIREMENTS_FILE=${MOLECULE_REQUIREMENTS_FILE:-./requirements.yml}
if [ "${MOLECULE_CUSTOM_MODULES_REPO}" ]; then
mkdir ./library/
git clone "$MOLECULE_CUSTOM_MODULES_REPO" ./library/
fi
if [ "${MOLECULE_CUSTOM_FILTERS_REPO}" ]; then
mkdir -p ./plugins/filters/
git clone "$MOLECULE_CUSTOM_FILTERS_REPO" ./plugins/filters/
fi
if [ -f "$MOLECULE_REQUIREMENTS_FILE" ]; then
ansible-galaxy install --force -r "$MOLECULE_REQUIREMENTS_FILE" -p "$ANSIBLE_ROLES_PATH"
fi