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,5 +1,5 @@
---
- set_fact:
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-buscarron.service'] }}"
when: matrix_bot_buscarron_enabled|bool

View File

@ -1,5 +1,5 @@
---
- set_fact:
- ansible.builtin.set_fact:
matrix_bot_buscarron_requires_restart: false
- block:
@ -9,7 +9,7 @@
register: matrix_bot_buscarron_sqlite_database_path_local_stat_result
- block:
- set_fact:
- ansible.builtin.set_fact:
matrix_postgres_db_migration_request:
src: "{{ matrix_bot_buscarron_sqlite_database_path_local }}"
dst: "{{ matrix_bot_buscarron_database_connection_string }}"
@ -20,13 +20,13 @@
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
- set_fact:
- ansible.builtin.set_fact:
matrix_bot_buscarron_requires_restart: true
when: "matrix_bot_buscarron_sqlite_database_path_local_stat_result.stat.exists|bool"
when: "matrix_bot_buscarron_database_engine == 'postgres'"
- name: Ensure buscarron paths exist
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0750
@ -40,7 +40,7 @@
when: "item.when|bool"
- name: Ensure buscarron environment variables file created
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/env.j2"
dest: "{{ matrix_bot_buscarron_config_path }}/env"
owner: "{{ matrix_user_username }}"
@ -60,7 +60,7 @@
until: result is not failed
- name: Ensure buscarron repository is present on self-build
git:
ansible.builtin.git:
repo: "{{ matrix_bot_buscarron_docker_repo }}"
dest: "{{ matrix_bot_buscarron_docker_src_files_path }}"
force: "yes"
@ -82,19 +82,19 @@
when: "matrix_bot_buscarron_container_image_self_build|bool"
- name: Ensure matrix-bot-buscarron.service installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-bot-buscarron.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service"
mode: 0644
register: matrix_bot_buscarron_systemd_service_result
- name: Ensure systemd reloaded after matrix-bot-buscarron.service installation
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_bot_buscarron_systemd_service_result.changed|bool"
- name: Ensure matrix-bot-buscarron.service restarted, if necessary
service:
ansible.builtin.service:
name: "matrix-bot-buscarron.service"
state: restarted
when: "matrix_bot_buscarron_requires_restart|bool"

View File

@ -6,7 +6,7 @@
register: matrix_bot_buscarron_service_stat
- name: Ensure matrix-buscarron is stopped
service:
ansible.builtin.service:
name: matrix-bot-buscarron
state: stopped
enabled: false
@ -15,18 +15,18 @@
when: "matrix_bot_buscarron_service_stat.stat.exists|bool"
- name: Ensure matrix-bot-buscarron.service doesn't exist
file:
ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service"
state: absent
when: "matrix_bot_buscarron_service_stat.stat.exists|bool"
- name: Ensure systemd reloaded after matrix-bot-buscarron.service removal
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_bot_buscarron_service_stat.stat.exists|bool"
- name: Ensure Matrix buscarron paths don't exist
file:
ansible.builtin.file:
path: "{{ matrix_bot_buscarron_base_path }}"
state: absent

View File

@ -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] == ''"