run ansible-galaxy if requirements file is present
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-05-19 21:53:19 +02:00
parent 7907b88f09
commit 549f38c317
2 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,9 @@ 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/
@ -13,3 +16,7 @@ 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

View File

@ -4,6 +4,9 @@ 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 [ "$GCE_SSH_KEY" ]; then
echo "$GCE_SSH_KEY" > $HOME/.ssh/google_compute_engine
chmod 600 $HOME/.ssh/google_compute_engine
@ -24,3 +27,7 @@ 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