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

@ -1,7 +1,7 @@
---
- name: Ensure ma1sd paths exist
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0750
@ -18,7 +18,7 @@
# These (SQLite -> Postgres) migration tasks are usually at the top,
# but we'd like to run them after `migrate_mxisd.yml`, which requires the ma1sd paths to exist.
- set_fact:
- ansible.builtin.set_fact:
matrix_ma1sd_requires_restart: false
- block:
@ -28,7 +28,7 @@
register: matrix_ma1sd_sqlite_database_path_local_stat_result
- block:
- set_fact:
- ansible.builtin.set_fact:
matrix_postgres_db_migration_request:
src: "{{ matrix_ma1sd_sqlite_database_path_local }}"
dst: "{{ matrix_ma1sd_database_connection_string }}"
@ -40,7 +40,7 @@
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
- set_fact:
- ansible.builtin.set_fact:
matrix_ma1sd_requires_restart: true
when: "matrix_ma1sd_sqlite_database_path_local_stat_result.stat.exists|bool"
when: "matrix_ma1sd_database_engine == 'postgres'"
@ -59,7 +59,7 @@
- block:
- name: Ensure gradle is installed for self-building (Debian)
apt:
ansible.builtin.apt:
name:
- gradle
state: present
@ -67,7 +67,7 @@
when: (ansible_os_family == 'Debian')
- name: Ensure gradle is installed for self-building (RedHat)
fail:
ansible.builtin.fail:
msg: "Installing gradle on RedHat ({{ ansible_distribution }}) is currently not supported, so self-building ma1sd cannot happen at this time"
when: ansible_os_family == 'RedHat'
@ -80,7 +80,7 @@
when: ansible_distribution == 'Archlinux'
- name: Ensure ma1sd repository is present on self-build
git:
ansible.builtin.git:
repo: "{{ matrix_ma1sd_container_image_self_build_repo }}"
dest: "{{ matrix_ma1sd_docker_src_files_path }}"
version: "{{ matrix_ma1sd_container_image_self_build_branch }}"
@ -90,7 +90,7 @@
register: matrix_ma1sd_git_pull_results
- name: Ensure ma1sd Docker image is built
shell: "DOCKER_BUILDKIT=1 ./gradlew dockerBuild"
ansible.builtin.shell: "DOCKER_BUILDKIT=1 ./gradlew dockerBuild"
args:
chdir: "{{ matrix_ma1sd_docker_src_files_path }}"
when: matrix_ma1sd_git_pull_results.changed
@ -110,7 +110,7 @@
when: "matrix_ma1sd_container_image_self_build|bool"
- name: Ensure ma1sd config installed
copy:
ansible.builtin.copy:
content: "{{ matrix_ma1sd_configuration|to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_ma1sd_config_path }}/ma1sd.yaml"
mode: 0644
@ -118,7 +118,7 @@
group: "{{ matrix_user_groupname }}"
- name: Ensure custom view templates are installed, if any
copy:
ansible.builtin.copy:
content: "{{ item.value }}"
dest: "{{ matrix_ma1sd_config_path }}/{{ item.location }}"
mode: 0644
@ -130,7 +130,7 @@
when: "matrix_ma1sd_view_session_custom_templates_enabled|bool and item.value"
- name: Ensure custom email templates are installed, if any
copy:
ansible.builtin.copy:
content: "{{ item.value }}"
dest: "{{ matrix_ma1sd_config_path }}/{{ item.location }}"
mode: 0644
@ -145,7 +145,7 @@
# Only cleaning up for people who define the respective templates
- name: (Cleanup) Ensure custom email templates are not in data/ anymore (we've put them in config/)
file:
ansible.builtin.file:
path: "{{ matrix_ma1sd_data_path }}/{{ item.location }}"
state: absent
with_items:
@ -156,19 +156,19 @@
when: "matrix_ma1sd_threepid_medium_email_custom_templates_enabled|bool and item.value"
- name: Ensure matrix-ma1sd.service installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-ma1sd.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-ma1sd.service"
mode: 0644
register: matrix_ma1sd_systemd_service_result
- name: Ensure systemd reloaded after matrix-ma1sd.service installation
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_ma1sd_systemd_service_result.changed|bool"
- name: Ensure matrix-ma1sd.service restarted, if necessary
service:
ansible.builtin.service:
name: "matrix-ma1sd.service"
state: restarted
when: "matrix_ma1sd_requires_restart|bool"