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:
@ -1,17 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Fail if playbook called incorrectly
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "The `one_time` variable needs to be provided to this playbook, via --extra-vars"
|
||||
when: "one_time is not defined or one_time not in ['yes', 'no']"
|
||||
|
||||
- name: Fail if playbook called incorrectly
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: "The `ex_date` variable (expiration date) needs to be provided to this playbook, via --extra-vars"
|
||||
when: "ex_date is not defined or ex_date == '<date>'"
|
||||
|
||||
- name: Call matrix-registration token creation API
|
||||
uri:
|
||||
ansible.builtin.uri:
|
||||
url: "{{ matrix_registration_api_token_endpoint }}"
|
||||
follow_redirects: none
|
||||
validate_certs: "{{ matrix_registration_api_validate_certs }}"
|
||||
@ -28,7 +28,7 @@
|
||||
check_mode: false
|
||||
register: matrix_registration_api_result
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_registration_api_result_message: >-
|
||||
matrix-registration result:
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
check_mode: false
|
||||
|
||||
- name: Inject result message into matrix_playbook_runtime_results
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
matrix_playbook_runtime_results: |
|
||||
{{
|
||||
matrix_playbook_runtime_results|default([])
|
||||
|
@ -2,17 +2,17 @@
|
||||
# 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_registration_container_image_self_build and matrix_registration_enabled"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-registration.service'] }}"
|
||||
when: matrix_registration_enabled|bool
|
||||
|
||||
- block:
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append matrix-registration's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
@ -21,7 +21,7 @@
|
||||
when: matrix_nginx_proxy_role_executed|default(False)|bool
|
||||
|
||||
- name: Generate matrix-registration proxying configuration for matrix-nginx-proxy
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
matrix_registration_matrix_nginx_proxy_configuration: |
|
||||
rewrite ^{{ matrix_registration_public_endpoint }}$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/ permanent;
|
||||
rewrite ^{{ matrix_registration_public_endpoint }}/$ {{ matrix_nginx_proxy_x_forwarded_proto_value }}://$server_name{{ matrix_registration_public_endpoint }}/register redirect;
|
||||
@ -47,7 +47,7 @@
|
||||
}
|
||||
|
||||
- name: Register matrix-registration 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([])
|
||||
@ -59,7 +59,7 @@
|
||||
when: matrix_registration_enabled|bool
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the matrix-registration tool but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Call matrix-registration list all tokens API
|
||||
uri:
|
||||
ansible.builtin.uri:
|
||||
url: "{{ matrix_registration_api_token_endpoint }}"
|
||||
follow_redirects: none
|
||||
validate_certs: "{{ matrix_registration_api_validate_certs }}"
|
||||
@ -13,7 +13,7 @@
|
||||
check_mode: false
|
||||
register: matrix_registration_api_result
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_registration_api_result_message: >-
|
||||
matrix-registration result:
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
check_mode: false
|
||||
|
||||
- name: Inject result message into matrix_playbook_runtime_results
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
matrix_playbook_runtime_results: |
|
||||
{{
|
||||
matrix_playbook_runtime_results|default([])
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_registration_requires_restart: false
|
||||
|
||||
- block:
|
||||
@ -10,7 +10,7 @@
|
||||
register: matrix_registration_sqlite_database_path_local_stat_result
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_registration_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_registration_database_connection_string }}"
|
||||
@ -26,13 +26,13 @@
|
||||
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
|
||||
- set_fact:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_registration_requires_restart: true
|
||||
when: "matrix_registration_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_registration_database_engine == 'postgres'"
|
||||
|
||||
- name: Ensure matrix-registration paths exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
@ -58,7 +58,7 @@
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure matrix-registration repository is present when self-building
|
||||
git:
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_registration_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_registration_docker_src_files_path }}"
|
||||
version: "{{ matrix_registration_container_image_self_build_branch }}"
|
||||
@ -70,7 +70,7 @@
|
||||
|
||||
# See: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1864
|
||||
- name: Patch setup.py to allow self-built version to work
|
||||
lineinfile:
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ matrix_registration_docker_src_files_path }}/setup.py"
|
||||
regexp: 'flask-limiter'
|
||||
line: '"flask-limiter~=1.1.0", "Markupsafe<2.1",'
|
||||
@ -89,7 +89,7 @@
|
||||
when: "matrix_registration_container_image_self_build|bool"
|
||||
|
||||
- name: Ensure matrix-registration config installed
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_registration_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_registration_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
@ -97,19 +97,19 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-registration.service installed
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-registration.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-registration.service"
|
||||
mode: 0644
|
||||
register: matrix_registration_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-registration.service installation
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_registration_systemd_service_result.changed|bool"
|
||||
|
||||
- name: Ensure matrix-registration.service restarted, if necessary
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: "matrix-registration.service"
|
||||
state: restarted
|
||||
when: "matrix_registration_requires_restart|bool"
|
||||
|
@ -6,7 +6,7 @@
|
||||
register: matrix_registration_service_stat
|
||||
|
||||
- name: Ensure matrix-registration is stopped
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
name: matrix-registration
|
||||
state: stopped
|
||||
enabled: false
|
||||
@ -15,13 +15,13 @@
|
||||
when: "matrix_registration_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure matrix-registration.service doesn't exist
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-registration.service"
|
||||
state: absent
|
||||
when: "matrix_registration_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-registration.service removal
|
||||
service:
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_registration_service_stat.stat.exists|bool"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Fail if required matrix-registration settings not defined
|
||||
fail:
|
||||
ansible.builtin.fail:
|
||||
msg: >
|
||||
You need to define a required configuration setting (`{{ item }}`) for using matrix-registration.
|
||||
when: "vars[item] == ''"
|
||||
@ -11,7 +11,7 @@
|
||||
- "matrix_registration_server_location"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings
|
||||
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