ansible-collection-prometheus/roles/systemd_exporter/tasks/main.yml
Laurent Indermuehle f0973a0dbc
Add apply tags for all included tasks files
Signed-off-by: Laurent Indermuehle <laurent.indermuehle@epfl.ch>
2023-04-27 09:36:20 +02:00

60 lines
1.4 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
apply:
tags:
- systemd_exporter_install
- systemd_exporter_configure
- systemd_exporter_run
tags:
- systemd_exporter_install
- systemd_exporter_configure
- systemd_exporter_run
- name: Install
ansible.builtin.include_tasks:
file: install.yml
apply:
become: true
tags:
- systemd_exporter_install
when:
( not __systemd_exporter_is_installed.stat.exists ) or
( __systemd_exporter_current_version_output.stderr_lines[0].split(" ")[2] != systemd_exporter_version ) or
( systemd_exporter_binary_local_dir | length > 0 )
tags:
- systemd_exporter_install
- name: SELinux
ansible.builtin.include_tasks:
file: selinux.yml
apply:
become: true
tags:
- systemd_exporter_configure
when: ansible_selinux.status == "enabled"
tags:
- systemd_exporter_configure
- name: Configure
ansible.builtin.include_tasks:
file: configure.yml
apply:
become: true
tags:
- systemd_exporter_configure
tags:
- systemd_exporter_configure
- name: Ensure systemd exporter is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: systemd_exporter
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- systemd_exporter_run