3
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-03-25 22:17:25 +00:00
Files
matrix-docker-ansible-deploy/roles/custom/matrix_playbook_migration/tasks/validate_migration_version.yml
Slavi Pantaleev 9a9392d24a Add migration validation system to catch breaking changes early
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:10:01 +02:00

35 lines
1.7 KiB
YAML

# SPDX-FileCopyrightText: 2026 Slavi Pantaleev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: Fail if migration version is not validated (first-time onboarding)
ansible.builtin.fail:
msg: >-
This playbook now uses a migration validation system to help you stay aware of breaking changes.
It appears that you haven't configured the `matrix_playbook_migration_validated_version` variable yet.
Please review the changelog (https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md)
and then add the following to your vars.yml file:
matrix_playbook_migration_validated_version: {{ matrix_playbook_migration_expected_version }}
when: "matrix_playbook_migration_validated_version == ''"
- name: Fail if migration version is outdated
ansible.builtin.fail:
msg: |-
Your validated migration version ({{ matrix_playbook_migration_validated_version }}) is behind the expected version ({{ matrix_playbook_migration_expected_version }}).
The following breaking changes have been introduced since your last validation:
{% for item in matrix_playbook_migration_breaking_changes | selectattr('version', '>', matrix_playbook_migration_validated_version) | sort(attribute='version') %}
- {{ item.version }}: {{ item.summary }} ({{ item.changelog_url }})
{% endfor %}
After reviewing the above changes and adapting your setup, update your vars.yml:
matrix_playbook_migration_validated_version: "{{ matrix_playbook_migration_expected_version }}"
when: "matrix_playbook_migration_validated_version != '' and matrix_playbook_migration_validated_version < matrix_playbook_migration_expected_version"