2024-09-20 12:15:55 +00:00
|
|
|
---
|
|
|
|
- name: Ensure synapse_state is valid
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "State '{{ synapse_state }}' is not known, supported states are {{ synapse_states | join(', ') }}"
|
|
|
|
when: synapse_state not in synapse_states
|
|
|
|
|
|
|
|
- name: Ensure synapse deployment method is supported
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: >-
|
|
|
|
Deployment method '{{ synapse_deployment_method }}'
|
|
|
|
is unknown! Supported methods are:
|
|
|
|
{{ synapse_deployment_methods | join(', ') }}
|
|
|
|
when: synapse_deployment_method not in synapse_deployment_methods
|
|
|
|
|
|
|
|
- name: Ensure required variables are given
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "Required variable '{{ item }}' is undefined!"
|
|
|
|
loop: "{{ synapse_required_variables }}"
|
|
|
|
when: >-2
|
2024-10-07 16:18:03 +00:00
|
|
|
item not in hostvars[inventory_hostname]
|
|
|
|
or hostvars[inventory_hostname][item] | length == 0
|
2024-09-20 12:15:55 +00:00
|
|
|
|
|
|
|
- name: Ensure conditionally required variables are given
|
|
|
|
ansible.builtin.fail:
|
|
|
|
msg: "Required variable '{{ item.name }}' is undefined!"
|
|
|
|
loop: "{{ synapse_conditionally_required_variables }}"
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.name }}"
|
|
|
|
when: >-2
|
|
|
|
item.when
|
|
|
|
and (item.name not in hostvars[ansible_host]
|
|
|
|
or hostvars[ansible_host][item.name] | length == 0)
|