Update 2 files
- /home/dot_local/share/ansible/symlink_requirements.yml.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl
This commit is contained in:
parent
c5ac0b60de
commit
2040d0ede5
2 changed files with 18 additions and 12 deletions
|
@ -25,18 +25,24 @@ find "$HOME/.local/src/gas-station/roles" -mindepth 2 -maxdepth 2 -type d | whil
|
|||
fi
|
||||
done
|
||||
|
||||
if [ -f "$HOME/.local/src/gas-station/requirements.yml" ] && command -v ansible-galaxy > /dev/null; then
|
||||
logg info 'Ensuring Ansible Galaxy collections are installed'
|
||||
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
|
||||
if [ -f "$HOME/.local/src/gas-station/requirements.yml" ]; then
|
||||
if command -v ansible-galaxy > /dev/null; then
|
||||
logg info 'Ensuring Ansible Galaxy collections are installed'
|
||||
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
|
||||
else
|
||||
logg warn 'Unable to install the Ansible Galaxy requirements.yml since the ansible-galaxy executable is missing from the PATH'
|
||||
fi
|
||||
else
|
||||
logg warn '~/.local/src/gas-station/requirements.yml is missing'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{{- if true -}}
|
||||
{{ .host.home }}/.local/src/gas-station/playbooks
|
||||
{{ .host.home }}/.local/src/gas-station/requirements.yml
|
||||
{{- end -}}
|
||||
|
|
Loading…
Reference in a new issue