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,10 +2,10 @@
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the Element image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_corporal_container_image_self_build and matrix_corporal_enabled"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-corporal.service'] }}"
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
corporal_client_api_url_endpoint_public: "https://{{ matrix_server_fqn_matrix }}/_matrix/client/corporal"
|
||||
|
||||
- name: Check Matrix Corporal HTTP gateway
|
||||
uri:
|
||||
ansible.builtin.uri:
|
||||
url: "{{ corporal_client_api_url_endpoint_public }}"
|
||||
follow_redirects: none
|
||||
return_content: true
|
||||
@ -13,10 +13,10 @@
|
||||
ignore_errors: true
|
||||
|
||||
- name: Fail if Matrix Corporal HTTP gateway not working
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "Failed checking Matrix Corporal is fronting the Matrix Client API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ corporal_client_api_url_endpoint_public }}`). Is matrix-corporal running? Is port 443 open in your firewall? Full error: {{ result_corporal_client_api }}"
|
||||
when: "result_corporal_client_api.failed or 'Matrix Client-Server API protected by Matrix Corporal' not in result_corporal_client_api.content"
|
||||
|
||||
- name: Report working Matrix Corporal HTTP gateway
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "Matrix Corporal is fronting the Matrix Client API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ corporal_client_api_url_endpoint_public }}`)"
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
|
||||
- name: Ensure Matrix Corporal paths exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
@ -18,7 +18,7 @@
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure Matrix Corporal repository is present on self-build
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_corporal_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_corporal_container_src_files_path }}"
|
||||
version: "{{ matrix_corporal_docker_image.split(':')[1] }}"
|
||||
@ -53,7 +53,7 @@
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure Matrix Corporal config installed
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_corporal_configuration|to_nice_json }}"
|
||||
dest: "{{ matrix_corporal_config_dir_path }}/config.json"
|
||||
mode: 0644
|
||||
@ -62,7 +62,7 @@
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure matrix-corporal.service installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-corporal.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-corporal.service"
|
||||
mode: 0644
|
||||
@ -70,7 +70,7 @@
|
||||
when: matrix_corporal_enabled|bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-corporal.service installation
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_corporal_enabled|bool and matrix_corporal_systemd_service_result.changed"
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
when: "not matrix_corporal_enabled|bool"
|
||||
|
||||
- name: Ensure matrix-corporal is stopped
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: matrix-corporal
|
||||
state: stopped
|
||||
enabled: false
|
||||
@ -95,18 +95,18 @@
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-corporal.service doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-corporal.service"
|
||||
state: absent
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-corporal.service removal
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "not matrix_corporal_enabled|bool and matrix_corporal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-corporal files don't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Fail if required matrix-corporal settings not defined
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`) for using matrix-corporal.
|
||||
when: "vars[item] == ''"
|
||||
@ -12,12 +12,12 @@
|
||||
- "matrix_corporal_policy_provider_config"
|
||||
|
||||
- name: Fail if HTTP API enabled, but no token set
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "The Matrix Corporal HTTP API is enabled (`matrix_corporal_http_api_enabled`), but no auth token has been set in `matrix_corporal_http_api_auth_token`"
|
||||
when: "matrix_corporal_http_api_enabled|bool and matrix_corporal_http_api_auth_token == ''"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed corporal variables
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
|
||||
|
Reference in New Issue
Block a user