Add validation tasks to matrix-synapse-auto-compressor

housekeeping^2
Slavi Pantaleev 2 years ago
parent ca69fce648
commit 0f2e568b30

@ -27,7 +27,7 @@ matrix_synapse_auto_compressor_systemd_required_services_list: ['docker.service'
matrix_synapse_auto_compressor_systemd_wanted_services_list: [] matrix_synapse_auto_compressor_systemd_wanted_services_list: []
matrix_synapse_auto_compressor_database_username: 'synapse' matrix_synapse_auto_compressor_database_username: 'synapse'
matrix_synapse_auto_compressor_database_password: 'some-password' matrix_synapse_auto_compressor_database_password: ''
matrix_synapse_auto_compressor_database_hostname: '' matrix_synapse_auto_compressor_database_hostname: ''
matrix_synapse_auto_compressor_database_port: 5432 matrix_synapse_auto_compressor_database_port: 5432
matrix_synapse_auto_compressor_database_name: 'synapse' matrix_synapse_auto_compressor_database_name: 'synapse'

@ -1,6 +1,9 @@
--- ---
- block: - block:
- when: matrix_synapse_auto_compressor_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_synapse_auto_compressor_enabled | bool - when: matrix_synapse_auto_compressor_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"
tags: tags:

@ -0,0 +1,10 @@
---
- name: Fail if required matrix-synapse-auto-compressor settings not defined
ansible.builtin.fail:
msg: >
You need to define a required configuration setting (`{{ item }}`).
when: "vars[item] == ''"
with_items:
- matrix_synapse_auto_compressor_database_hostname
- matrix_synapse_auto_compressor_database_password
Loading…
Cancel
Save