No description
  • Python 86.5%
  • Jinja 13.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adrien Waksberg 1e5816e63a
All checks were successful
/ lint (push) Successful in 7s
/ molecule (push) Successful in 1m36s
chore: update readme
2026-08-08 08:36:48 +02:00
.forgejo/workflows first version 2026-07-24 07:32:59 +02:00
defaults first version 2026-07-24 07:32:59 +02:00
meta first version 2026-07-24 07:32:59 +02:00
molecule/default feat: add multiple files for a exporter 2026-07-29 08:13:35 +02:00
tasks feat: add multiple files for a exporter 2026-07-29 08:13:35 +02:00
templates feat: add multiple files for a exporter 2026-07-29 08:13:35 +02:00
.gitignore chore: add gitignore 2026-07-24 07:45:24 +02:00
.yamllint test: add .yamllint 2026-07-24 07:45:06 +02:00
CHANGELOG.md first version 2026-07-24 07:32:59 +02:00
LICENSE first version 2026-07-24 07:32:59 +02:00
README.md chore: update readme 2026-08-08 08:36:48 +02:00

Ansible role: Prometheus exporters

Version License Build

Install and configure Prometheus exporters

Requirements

  • Ansible >= 2.21
  • Debian
    • Trixie

Role variables

Name Type Required Default Comment
prometheus_exporters dict no exporters with config  

prometheus_exporters

Name Type Required Default Comment
key str yes exporter name
env dict no environment variables
files list(dict) no config file
state str no present if absent, uninstall exporter

Example:

node:
  env:
    ARGS:
      - "--collector.filesystem.mount-points-exclude=/test"
      - "--collector.systemd.unit-exclude=prometheus"
mysql:
  files:
    - path: "/var/lib/prometheus/.my.cnf"
      content: |-
        [client]
        database=mysql
        user=username
        host=localhost
        password=secret

prometheus_exporters.env

Name Type Required Default Comment
key str yes environment variable name
value str or list yes   value of environment variable

prometheus_exporters.files

Name Type Required Default Comment
path str yes config file path
content str yes content of config file

How to use

- hosts: server
  roles:
    - nishiki.prometheus_exports
  vars
    prometheus_exporters:
      node:
        env:
          ARGS:
            - "--collector.filesystem.mount-points-exclude=/test"
            - "--collector.systemd.unit-exclude=prometheus"
      mysql:
        files:
          - path: "/var/lib/prometheus/.my.cnf"
            content: |-
              [client]
              database=mysql
              user=username
              host=localhost
              password=secret

Development

Test with molecule and docker

  • install docker
  • install python3 and python3-pip
  • install molecule and dependencies pip3 install molecule molecule-plugins ansible-lint pytest-testinfra yamllint
  • run molecule test

License

Copyright (c) 2026 Adrien Waksberg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.