Install missing and outdated roles before running the playbook

Pulling a playbook update which adds roles or bumps their versions
required running `just roles` before the playbook could use them.
Otherwise, the run failed on a missing role or used an outdated one.

`just run`, and so `just install-all`, `just setup-all` and the other
recipes based on it, as well as `just register-user`, now first install
missing and outdated roles, the same way `just roles` does: roles with
local changes are kept (with a warning), as are symlinked roles and
roles containing a `.git` directory. When all roles are up to date,
nothing is downloaded and nothing is printed.

The same change in mash-playbook:
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/75b1c3ac

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-10-25 09:42:48 +02:00
co-authored by Claude Opus 5.5
parent bcb862c7ff
commit 5274815c62
+2 -2
View File
@@ -119,7 +119,7 @@ install-service service *extra_args:
setup-all *extra_args: (run-tags "setup-all,ensure-matrix-users-created,start" extra_args)
# Runs the playbook with the given list of arguments
run +extra_args:
run +extra_args: (_install-roles "--quiet")
ansible-playbook -i {{ inventory }} setup.yml {{ extra_args }}
# Runs the playbook with the given list of comma-separated tags and optional arguments
@@ -127,7 +127,7 @@ run-tags tags *extra_args:
{{ just_executable() }} --justfile "{{ justfile() }}" run --tags={{ tags }} {{ extra_args }}
# Runs the playbook in user-registration mode
register-user username password admin_yes_or_no *extra_args:
register-user username password admin_yes_or_no *extra_args: (_install-roles "--quiet")
ansible-playbook -i {{ inventory }} setup.yml --tags=register-user --extra-vars="username={{ username }} password={{ password }} admin={{ admin_yes_or_no }}" {{ extra_args }}
# Starts all services