mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-30 23:59:11 +00:00
f0973a0dbc
Signed-off-by: Laurent Indermuehle <laurent.indermuehle@epfl.ch>
60 lines
1.4 KiB
YAML
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
|