refactor: add pre-tasks for installing Ansible collections and improve final setup messages
All checks were successful
Nix Format Check / check-format (push) Successful in 37s

This commit is contained in:
Menno van Leeuwen 2025-01-22 16:22:15 +01:00
parent 6ffb65fbc0
commit 35ffc77056
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
3 changed files with 13 additions and 5 deletions

View File

@ -2,6 +2,12 @@
hosts: all
gather_facts: true
pre_tasks:
- name: Install required collections
ansible.builtin.command: ansible-galaxy collection install -r requirements.yml
delegate_to: localhost
run_once: true
tasks:
- name: Include global tasks
ansible.builtin.import_tasks: tasks/global/global.yml

View File

@ -0,0 +1,4 @@
---
# Collections section
collections:
- community.general

View File

@ -387,12 +387,10 @@ main() {
# Create setup marker
touch "$SETUP_MARKER" || die "Failed to create setup marker"
# Initial run of dotf update
dotf update || die "Failed to run 'dotf update', please see the output for more information"
# Final success message
log_success "\nSetup complete, it shouldn't be necessary but to be sure, please restart your shell.\n"
log_success "You can now run 'dotf' to manage your dotfiles.\n"
log_success "\nSetup complete. Please logout / restart to continue with 'dotf update'.\n"
log_error "\n!!! Please logout / restart to continue !!!"
log_error "~~~ Proceed by running 'dotf update' ~~~\n"
}
main "$@"