agru replaces an installed role whenever its version differs from the
pinned one, and also when the role has no install information. It
replaces a symlinked role with a fresh copy. ansible-galaxy was run on
an emptied roles/galaxy every time. Roles being worked on in
roles/galaxy could thus silently lose their changes.
bin/install-roles.py (run through bin/ansible-python.sh, so PyYAML
needs no separate installation) now decides which roles need to be
(re)installed and only passes those to agru or ansible-galaxy:
- missing roles are installed, and outdated roles are replaced
- outdated roles which were changed since they were installed are kept,
with a warning. Changes are detected by comparing the role's contents
with a checksum recorded at installation, in run/installed-roles.yml.
Roles installed before (without a checksum) are considered unchanged.
- outdated roles which were not installed by agru or ansible-galaxy
are kept, with a warning
- symlinked roles and roles containing a `.git` directory are never
touched
`just roles --force` replaces changed roles too. `just update -u` now
only updates the pinned versions with agru and leaves installing the
roles to the script, so that it keeps changed roles as well.
The same script in mash-playbook (where its tests live, and where it
also deletes the roles of services no longer in use):
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/d5c5e0cehttps://github.com/mother-of-all-self-hosting/mash-playbook/commit/608a7943
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bin/ansible-python.sh runs Python with the interpreter named in the
first line of `ansible-playbook`. That interpreter has PyYAML, since
Ansible depends on it, even when Ansible is installed in an environment
of its own (e.g. with pipx), where the system's `python3` may lack it.
If it is not a Python interpreter (e.g. `ansible-playbook` is a wrapper
script), or Ansible is missing, `python3` is used.
Role installation, which needs PyYAML, is the first to use it in the
next commit, so that it works without installing PyYAML separately.
The same script in mash-playbook (where its tests live):
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/1fe0f90f
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`just update` pulled the playbook first and only then looked at its
flags. An unknown flag printed a message and was then passed to agru
anyway, and `-u` without agru was silently ignored.
Both now stop `just update` with an error, before anything is pulled.
The same change in mash-playbook:
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/0598aa82
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`just update` had its own copy of the agru and ansible-galaxy calls.
It now installs roles through `_install-roles`, like `just roles`.
With `-u` (and agru), it still updates the role versions pinned in
requirements.yml, which also installs them.
The same change in mash-playbook (which additionally regenerates its
optimized files there):
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/32db6a41
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`just roles` and `just update` each had their own copy of the agru and
ansible-galaxy calls. Move them to a private `_install-roles` recipe,
used by `just roles` for now, so that `just update` can use it too.
The same change in mash-playbook:
https://github.com/mother-of-all-self-hosting/mash-playbook/commit/6433a355
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ansible-role-postgres v18.6-2 renamed the
`postgres_postgres_process_extra_arguments_*` variables to
`postgres_process_extra_arguments_*`. Its validation now stops the
playbook when an old name is set, so a configuration copied from the
"Tuning PostgreSQL" section fails.
Its default value on ansible-role-etherpad is soon to be removed.
Signed-off-by: Suguru Hirahara <did:key:z6MkvVZk1A3KBApWJXv2Ju4H14ErDfRGxh8zxdXSZ4vACDg5>