Update file run_onchange_after_11-symlink-ansible-roles.tmpl

This commit is contained in:
Brian Zalewski 2023-01-05 05:35:24 +00:00
parent 04f5183cde
commit 603f383b07

View file

@ -27,5 +27,15 @@ done
if [ -f "$HOME/.local/src/gas-station/requirements.yml" ] && command -v ansible-galaxy > /dev/null; then if [ -f "$HOME/.local/src/gas-station/requirements.yml" ] && command -v ansible-galaxy > /dev/null; then
logg info 'Ensuring Ansible Galaxy collections are installed' logg info 'Ensuring Ansible Galaxy collections are installed'
ansible-galaxy install -r "$HOME/.local/src/gas-station/requirements.yml" ansible-galaxy install -r "$HOME/.local/src/gas-station/requirements.yml" || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg error 'Failed to install Ansible requirements from Ansible Galaxy'
if [ -d "$HOME/.local/src/gas-station/collections" ]; then
logg info 'Attempting to use locally stored Ansible requirements'
cd "$HOME/.local/src/gas-station/collections"
ansible-galaxy install -r requirements.yml || SECOND_EXIT_CODE=$?
if [ -n "$SECOND_EXIT_CODE" ]; then
logg error 'Failed to install requirements from both the cloud and the local copy' && exit 1
fi
fi
fi fi