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:
Slavi Pantaleev
2022-07-18 10:39:08 +03:00
parent 78b5be4a26
commit 34cdaade08
297 changed files with 1420 additions and 1420 deletions

View File

@ -2,14 +2,14 @@
# 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_coturn_container_image_self_build and matrix_coturn_enabled"
- set_fact:
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-coturn.service'] }}"
when: matrix_coturn_enabled|bool
- set_fact:
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-coturn-reload.timer'] }}"
when: "matrix_coturn_enabled|bool and matrix_coturn_tls_enabled|bool"

View File

@ -2,12 +2,12 @@
# This is a cleanup/migration task. It can be removed some time in the future.
- name: (Migration) Remove deprecated cronjob
file:
ansible.builtin.file:
path: "{{ matrix_cron_path }}/matrix-coturn-ssl-reload"
state: absent
- name: Ensure Matrix Coturn path exists
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0750
@ -31,7 +31,7 @@
- block:
- name: Ensure Coturn repository is present on self-build
git:
ansible.builtin.git:
repo: "{{ matrix_coturn_container_image_self_build_repo }}"
dest: "{{ matrix_coturn_docker_src_files_path }}"
version: "{{ matrix_coturn_container_image_self_build_repo_version }}"
@ -53,7 +53,7 @@
when: "matrix_coturn_container_image_self_build|bool"
- name: Ensure Coturn configuration path exists
file:
ansible.builtin.file:
path: "{{ matrix_coturn_base_path }}"
state: directory
mode: 0750
@ -61,7 +61,7 @@
group: "{{ matrix_user_groupname }}"
- name: Ensure turnserver.conf installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/turnserver.conf.j2"
dest: "{{ matrix_coturn_config_path }}"
mode: 0644
@ -74,7 +74,7 @@
driver: bridge
- name: Ensure matrix-coturn.service installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-coturn.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-coturn.service"
mode: 0644
@ -84,7 +84,7 @@
# We optimize for the common use-case though (short-lived Let's Encrypt certificates).
# Reloading doesn't hurt anyway, so there's no need to make this more flexible.
- name: Ensure reloading systemd units installed, if necessary
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/{{ item }}.j2"
dest: "{{ matrix_systemd_path }}/{{ item }}"
mode: 0644
@ -96,7 +96,7 @@
# A similar task exists in `setup_uninstall.yml`
- name: Ensure reloading systemd units uninstalled, if unnecessary
file:
ansible.builtin.file:
path: "{{ item }}"
state: absent
register: "matrix_coturn_systemd_service_change_results"
@ -106,6 +106,6 @@
- matrix-coturn-reload.timer
- name: Ensure systemd reloaded if systemd units changed
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_coturn_systemd_service_change_results.changed"

View File

@ -7,7 +7,7 @@
when: "not matrix_coturn_enabled|bool"
- name: Ensure matrix-coturn is stopped
service:
ansible.builtin.service:
name: matrix-coturn
state: stopped
enabled: false
@ -15,7 +15,7 @@
when: "matrix_coturn_service_stat.stat.exists|bool"
- name: Ensure matrix-coturn-reload.timer is stopped
service:
ansible.builtin.service:
name: matrix-coturn
state: stopped
enabled: false
@ -24,7 +24,7 @@
when: "matrix_coturn_service_stat.stat.exists|bool"
- name: Ensure systemd units don't exist
file:
ansible.builtin.file:
path: "{{ matrix_systemd_path }}/{{ item }}"
state: absent
register: matrix_coturn_systemd_unit_uninstallation_result
@ -34,12 +34,12 @@
- matrix-coturn-reload.timer
- name: Ensure systemd reloaded after unit removal
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_coturn_systemd_unit_uninstallation_result.changed|bool"
- name: Ensure Matrix coturn paths don't exist
file:
ansible.builtin.file:
path: "{{ matrix_coturn_base_path }}"
state: absent

View File

@ -1,7 +1,7 @@
---
- name: Fail if required Coturn settings not defined
fail:
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item }}`) for using Coturn.
when: "vars[item] == ''"