Replace matrix_playbook_runtime_results with devture_playbook_runtime_messages_list (via com.devture.ansible.role.playbook_runtime_messages)

This commit is contained in:
Slavi Pantaleev 2022-11-04 16:19:17 +02:00
parent c3a7237de7
commit db19482d0c
11 changed files with 24 additions and 35 deletions

View file

@ -66,9 +66,9 @@
- name: Inject result - name: Inject result
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_irc_data_path }}/*.db` to `{{ matrix_appservice_irc_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." "NOTE: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_irc_data_path }}/*.db` to `{{ matrix_appservice_irc_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."

View file

@ -62,9 +62,9 @@
- name: Inject result - name: Inject result
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your appservice-slack database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_slack_data_path }}/*.db` to `{{ matrix_appservice_slack_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." "NOTE: Your appservice-slack database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_slack_data_path }}/*.db` to `{{ matrix_appservice_slack_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."

View file

@ -14,9 +14,9 @@
block: block:
- name: Inject warning if on an old SQLite-supporting version - name: Inject warning if on an old SQLite-supporting version
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your mautrix-facebook bridge is still on SQLite and on the last version that supported it, before support was dropped. Support has been subsequently re-added in v0.3.2, so we advise you to upgrade (by removing your `matrix_mautrix_facebook_docker_image` definition from vars.yml)" "NOTE: Your mautrix-facebook bridge is still on SQLite and on the last version that supported it, before support was dropped. Support has been subsequently re-added in v0.3.2, so we advise you to upgrade (by removing your `matrix_mautrix_facebook_docker_image` definition from vars.yml)"

View file

@ -1,7 +0,0 @@
---
# Ansible outputs the message in the `item=` field.
# It's unnecessary to output it again in the actual message, so we don't.
- ansible.builtin.debug:
msg: ""
with_items: "{{ matrix_playbook_runtime_results }}"
when: "matrix_playbook_runtime_results is defined and matrix_playbook_runtime_results | length > 0"

View file

@ -10,10 +10,6 @@
tags: tags:
- stop - stop
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/dump_runtime_results.yml"
tags:
- always
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/run_docker_prune.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/run_docker_prune.yml"
tags: tags:
- run-docker-prune - run-docker-prune

View file

@ -101,9 +101,9 @@
# We just want to notify the user. Deleting data is too destructive. # We just want to notify the user. Deleting data is too destructive.
- name: Inject warning if matrix-postgres backup data remains - name: Inject warning if matrix-postgres backup data remains
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: You are not using the local backup service to backup the PostgreSQL database, but some old data remains from before in `{{ matrix_postgres_backup_path }}`. Feel free to delete it." "NOTE: You are not using the local backup service to backup the PostgreSQL database, but some old data remains from before in `{{ matrix_postgres_backup_path }}`. Feel free to delete it."

View file

@ -92,9 +92,9 @@
- name: Inject result - name: Inject result
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your SQLite database file has been imported into Postgres. The original file has been moved from `{{ sqlite_database_path }}` to `{{ sqlite_database_path }}.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete this file." "NOTE: Your SQLite database file has been imported into Postgres. The original file has been moved from `{{ sqlite_database_path }}` to `{{ sqlite_database_path }}.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete this file."

View file

@ -166,9 +166,9 @@
- name: Inject result - name: Inject result
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your {{ matrix_postgres_db_migration_request.engine_old }} database file has been imported into Postgres. The original database file has been moved from `{{ matrix_postgres_db_migration_request.src }}` to `{{ matrix_postgres_db_migration_request.src }}.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete this file." "NOTE: Your {{ matrix_postgres_db_migration_request.engine_old }} database file has been imported into Postgres. The original database file has been moved from `{{ matrix_postgres_db_migration_request.src }}` to `{{ matrix_postgres_db_migration_request.src }}.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete this file."

View file

@ -25,9 +25,9 @@
- name: Inject warning if on an old version of Postgres - name: Inject warning if on an old version of Postgres
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: Your setup is on an old Postgres version ({{ matrix_postgres_docker_image_to_use }}), while {{ matrix_postgres_docker_image_latest }} is supported. You can upgrade using --tags=upgrade-postgres" "NOTE: Your setup is on an old Postgres version ({{ matrix_postgres_docker_image_to_use }}), while {{ matrix_postgres_docker_image_latest }} is supported. You can upgrade using --tags=upgrade-postgres"
@ -146,9 +146,9 @@
- name: Inject warning if backup data remains - name: Inject warning if backup data remains
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: You have some Postgres backup data in `{{ matrix_postgres_data_path }}-auto-upgrade-backup`, which was created during the last major Postgres update you ran. If your setup works well after this upgrade, feel free to delete this whole directory." "NOTE: You have some Postgres backup data in `{{ matrix_postgres_data_path }}-auto-upgrade-backup`, which was created during the last major Postgres update you ran. If your setup works well after this upgrade, feel free to delete this whole directory."
@ -194,9 +194,9 @@
# We just want to notify the user. Deleting data is too destructive. # We just want to notify the user. Deleting data is too destructive.
- name: Inject warning if matrix-postgres local data remains - name: Inject warning if matrix-postgres local data remains
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[ [
"NOTE: You are not using a local PostgreSQL database, but some old data remains from before in `{{ matrix_postgres_data_path }}`. Feel free to delete it." "NOTE: You are not using a local PostgreSQL database, but some old data remains from before in `{{ matrix_postgres_data_path }}`. Feel free to delete it."

View file

@ -41,11 +41,11 @@
{{ matrix_registration_api_result.json }} {{ matrix_registration_api_result.json }}
check_mode: false check_mode: false
- name: Inject result message into matrix_playbook_runtime_results - name: Inject result message into devture_playbook_runtime_messages_list
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[matrix_registration_api_result_message] [matrix_registration_api_result_message]
}} }}

View file

@ -20,11 +20,11 @@
{{ matrix_registration_api_result.json | to_nice_json }} {{ matrix_registration_api_result.json | to_nice_json }}
check_mode: false check_mode: false
- name: Inject result message into matrix_playbook_runtime_results - name: Inject result message into devture_playbook_runtime_messages_list
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | devture_playbook_runtime_messages_list: |
{{ {{
matrix_playbook_runtime_results | default([]) devture_playbook_runtime_messages_list | default([])
+ +
[matrix_registration_api_result_message] [matrix_registration_api_result_message]
}} }}