mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-12-23 00:37:33 +01:00
Add prometheus-ipmi-exporter role
This commit is contained in:
parent
ca2cc8da62
commit
ddc99c03cb
8 changed files with 102 additions and 1 deletions
|
@ -7,7 +7,7 @@ namespace: s3lph
|
|||
name: prometheus
|
||||
|
||||
# The version of the collection. Must be compatible with semantic versioning
|
||||
version: 0.9.1
|
||||
version: 0.9.2
|
||||
|
||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||
readme: README.md
|
||||
|
|
25
roles/ipmi_exporter/defaults/main.yml
Normal file
25
roles/ipmi_exporter/defaults/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
ipmi_exporter_additional_options: ""
|
||||
|
||||
ipmi_exporter_config: |
|
||||
modules:
|
||||
default:
|
||||
collectors:
|
||||
- ipmi
|
||||
- dcmi
|
||||
- bmc
|
||||
- chassis
|
||||
- sel
|
||||
collector_cmd:
|
||||
ipmi: sudo
|
||||
dcmi: sudo
|
||||
bmc: sudo
|
||||
chassis: sudo
|
||||
sel: sudo
|
||||
custom_args:
|
||||
ipmi: ["/usr/sbin/ipmimonitoring"]
|
||||
dcmi: ["/usr/sbin/ipmi-dcmi"]
|
||||
bmc: ["/usr/sbin/bmc-info"]
|
||||
chassis: ["/usr/sbin/ipmi-chassis"]
|
||||
sel: ["/usr/sbin/ipmi-sel"]
|
6
roles/ipmi_exporter/handlers/main.yml
Normal file
6
roles/ipmi_exporter/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
|
||||
- name: restart prometheus-ipmi-exporter
|
||||
ansible.builtin.service:
|
||||
name: prometheus-ipmi-exporter
|
||||
state: restarted
|
25
roles/ipmi_exporter/tasks/config.yml
Normal file
25
roles/ipmi_exporter/tasks/config.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
- name: Render /etc/prometheus/ipmi-exporter/config.yaml
|
||||
ansible.builtin.template:
|
||||
src: etc/prometheus/ipmi-exporter/config.yaml.j2
|
||||
dest: /etc/prometheus/ipmi-exporter/config.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart prometheus-ipmi-exporter
|
||||
|
||||
- name: Render /etc/default/prometheus-ipmi-exporter
|
||||
ansible.builtin.template:
|
||||
src: etc/default/prometheus-ipmi-exporter.j2
|
||||
dest: /etc/default/prometheus-ipmi-exporter
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart prometheus-ipmi-exporter
|
||||
|
||||
- name: Start and enable prometheus-ipmi-exporter
|
||||
ansible.builtin.service:
|
||||
name: prometheus-ipmi-exporter
|
||||
state: started
|
||||
enabled: yes
|
15
roles/ipmi_exporter/tasks/install.yml
Normal file
15
roles/ipmi_exporter/tasks/install.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Add repo.s3lph.me key
|
||||
ansible.builtin.apt_key:
|
||||
url: https://repo.s3lph.me/debian/repo.s3lph.me.gpg
|
||||
keyring: /etc/apt/trusted.gpg.d/repo.s3lph.me.gpg
|
||||
|
||||
- name: Add repo.s3lph.me
|
||||
ansible.builtin.apt_repository:
|
||||
filename: repo.s3lph.me.list
|
||||
repo: deb https://repo.s3lph.me/debian stable main
|
||||
|
||||
- name: Install prometheus-ipmi-exporter from system package sources
|
||||
ansible.builtin.apt:
|
||||
name: prometheus-ipmi-exporter
|
13
roles/ipmi_exporter/tasks/main.yml
Normal file
13
roles/ipmi_exporter/tasks/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
|
||||
- name: install prometheus-ipmi-exporter
|
||||
ansible.builtin.import_tasks: install.yml
|
||||
tags:
|
||||
- "role::ipmi_exporter"
|
||||
- "role::ipmi_exporter:install"
|
||||
|
||||
- name: configure prometheus-ipmi-exporter
|
||||
ansible.builtin.import_tasks: config.yml
|
||||
tags:
|
||||
- "role::ipmi_exporter"
|
||||
- "role::ipmi_exporter:config"
|
|
@ -0,0 +1,13 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
ARGS="--config.file=/etc/prometheus/ipmi-exporter/config.yaml {{ ipmi_exporter_additional_options }}"
|
||||
|
||||
# GLOBAL OPTIONS:
|
||||
# --config.file=CONFIG.FILE Path to configuration file.
|
||||
# --freeipmi.path=FREEIPMI.PATH Path to FreeIPMI executables (default: rely on $PATH).
|
||||
# --web.listen-address=":9290" Address to listen on for web interface and telemetry.
|
||||
# --web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.
|
||||
# --log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error]
|
||||
# --log.format=logfmt Output format of log messages. One of: [logfmt, json]
|
||||
# --version Show application version.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
{{ ansible_managed | comment }}
|
||||
|
||||
{{ ipmi_exporter_config }}
|
Loading…
Reference in a new issue