Use fully-qualified module names for builtin Ansible modules
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1939
This commit is contained in:
@ -2,17 +2,17 @@
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-webhooks.service'] }}"
|
||||
when: matrix_appservice_webhooks_enabled|bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{
|
||||
matrix_synapse_container_extra_arguments|default([])
|
||||
@ -31,14 +31,14 @@
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- block:
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append webhooks Appservice's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
@ -47,7 +47,7 @@
|
||||
when: matrix_nginx_proxy_role_executed|default(False)|bool
|
||||
|
||||
- name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
matrix_appservice_webhooks_matrix_nginx_proxy_configuration: |
|
||||
{% if matrix_nginx_proxy_enabled|default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
@ -64,7 +64,7 @@
|
||||
{% endif %}
|
||||
|
||||
- name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
|
||||
@ -76,7 +76,7 @@
|
||||
when: matrix_appservice_webhooks_enabled|bool
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the Matrix webhooks bridge but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Ensure AppService webhooks paths exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
- block:
|
||||
- name: Ensure Appservice webhooks repository is present on self-build
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_appservice_webhooks_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_appservice_webhooks_docker_src_files_path }}"
|
||||
version: "{{ matrix_appservice_webhooks_container_image_self_build_repo_version }}"
|
||||
@ -50,7 +50,7 @@
|
||||
when: "matrix_appservice_webhooks_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure Matrix Appservice webhooks config is installed
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_appservice_webhooks_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_appservice_webhooks_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
@ -58,7 +58,7 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure Matrix Appservice webhooks schema.yml template exists
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/schema.yml.j2"
|
||||
dest: "{{ matrix_appservice_webhooks_config_path }}/schema.yml"
|
||||
mode: 0644
|
||||
@ -66,7 +66,7 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure Matrix Appservice webhooks database.json template exists
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/database.json.j2"
|
||||
dest: "{{ matrix_appservice_webhooks_data_path }}/database.json"
|
||||
mode: 0644
|
||||
@ -74,7 +74,7 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure appservice-webhooks registration.yaml installed
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_appservice_webhooks_registration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml"
|
||||
mode: 0644
|
||||
@ -82,13 +82,13 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-appservice-webhooks.service installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-appservice-webhooks.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-appservice-webhooks.service"
|
||||
mode: 0644
|
||||
register: matrix_appservice_webhooks_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-webhooks.service installation
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_webhooks_systemd_service_result.changed"
|
||||
|
@ -6,7 +6,7 @@
|
||||
register: matrix_appservice_webhooks_service_stat
|
||||
|
||||
- name: Ensure matrix-appservice-webhooks is stopped
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-webhooks
|
||||
state: stopped
|
||||
enabled: false
|
||||
@ -14,12 +14,12 @@
|
||||
when: "matrix_appservice_webhooks_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-appservice-webhooks.service doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-appservice-webhooks.service"
|
||||
state: absent
|
||||
when: "matrix_appservice_webhooks_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-webhooks.service removal
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_webhooks_service_stat.stat.exists"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
|
Reference in New Issue
Block a user