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-prometheus.service'] }}"
when: matrix_prometheus_enabled|bool

View File

@ -12,7 +12,7 @@
until: result is not failed
- name: Ensure Prometheus paths exists
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0750
@ -24,7 +24,7 @@
- "{{ matrix_prometheus_data_path }}"
- name: Download synapse-v2.rules
get_url:
ansible.builtin.get_url:
url: "{{ matrix_prometheus_scraper_synapse_rules_download_url }}"
dest: "{{ matrix_prometheus_config_path }}/synapse-v2.rules"
force: true
@ -38,7 +38,7 @@
until: result is not failed
- name: Ensure prometheus.yml installed
copy:
ansible.builtin.copy:
content: "{{ matrix_prometheus_configuration|to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_prometheus_config_path }}/prometheus.yml"
mode: 0644
@ -46,13 +46,13 @@
group: "{{ matrix_user_groupname }}"
- name: Ensure matrix-prometheus.service installed
template:
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-prometheus.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-prometheus.service"
mode: 0644
register: matrix_prometheus_systemd_service_result
- name: Ensure systemd reloaded after matrix-prometheus.service installation
service:
ansible.builtin.service:
daemon_reload: true
when: "matrix_prometheus_systemd_service_result.changed|bool"

View File

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

View File

@ -1,7 +1,7 @@
---
- name: Fail if Synapse metrics or Prometheus Node Exporter not enabled
fail:
ansible.builtin.fail:
msg: >
You need to enable `matrix_prometheus_scraper_synapse_enabled` and/or `matrix_prometheus_scraper_node_enabled` for Prometheus grab metrics.
when: "not matrix_prometheus_scraper_synapse_enabled and not matrix_prometheus_scraper_node_enabled"