More ansible-lint fixes
This commit is contained in:
@ -75,8 +75,8 @@ matrix_prometheus_configuration_extension_yaml: |
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_prometheus_configuration_yaml`.
|
||||
|
||||
matrix_prometheus_configuration_extension: "{{ matrix_prometheus_configuration_extension_yaml|from_yaml if matrix_prometheus_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
matrix_prometheus_configuration_extension: "{{ matrix_prometheus_configuration_extension_yaml | from_yaml if matrix_prometheus_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_prometheus_configuration_yaml`.
|
||||
matrix_prometheus_configuration: "{{ matrix_prometheus_configuration_yaml|from_yaml|combine(matrix_prometheus_configuration_extension, recursive=True) }}"
|
||||
matrix_prometheus_configuration: "{{ matrix_prometheus_configuration_yaml | from_yaml|combine(matrix_prometheus_configuration_extension, recursive=True) }}"
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-prometheus.service'] }}"
|
||||
when: matrix_prometheus_enabled|bool
|
||||
when: matrix_prometheus_enabled | bool
|
||||
|
@ -1,23 +1,23 @@
|
||||
---
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_prometheus_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_prometheus_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-prometheus
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_prometheus_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_prometheus_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-prometheus
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_prometheus_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_prometheus_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-prometheus
|
||||
|
@ -31,7 +31,7 @@
|
||||
mode: 0440
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
when: "matrix_prometheus_scraper_synapse_rules_enabled|bool"
|
||||
when: "matrix_prometheus_scraper_synapse_rules_enabled | bool"
|
||||
register: result
|
||||
retries: "{{ matrix_geturl_retries_count }}"
|
||||
delay: "{{ matrix_geturl_retries_delay }}"
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
- name: Ensure prometheus.yml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_prometheus_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_prometheus_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_prometheus_config_path }}/prometheus.yml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -55,4 +55,4 @@
|
||||
- name: Ensure systemd reloaded after matrix-prometheus.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_prometheus_systemd_service_result.changed|bool"
|
||||
when: "matrix_prometheus_systemd_service_result.changed | bool"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-prometheus service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-prometheus.service"
|
||||
register: matrix_prometheus_service_stat
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_prometheus_service_stat.stat.exists|bool"
|
||||
when: "matrix_prometheus_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure matrix-prometheus.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-prometheus.service"
|
||||
state: absent
|
||||
when: "matrix_prometheus_service_stat.stat.exists|bool"
|
||||
when: "matrix_prometheus_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-prometheus.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_prometheus_service_stat.stat.exists|bool"
|
||||
when: "matrix_prometheus_service_stat.stat.exists | bool"
|
||||
|
Reference in New Issue
Block a user