No description
  • Python 87.6%
  • Jinja 12.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adrien Waksberg 7f47652275
Some checks failed
/ lint (push) Successful in 8s
/ molecule (push) Failing after 1m29s
test: fix mistake on role name in converge file
2026-07-24 07:48:05 +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 test: fix mistake on role name in converge file 2026-07-24 07:48:05 +02:00
tasks first version 2026-07-24 07:32:59 +02:00
templates first version 2026-07-24 07:32:59 +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 first version 2026-07-24 07:32:59 +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_exports dict no exporters with config  

prometheus_exports

Name Type Required Default Comment
key str yes exporter name
env dict no environment variables
file 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:
  file:
    path: "/var/lib/prometheus/.my.cnf"
    content: |-
      [client]
      database=mysql
      user=username
      host=localhost
      password=secret

prometheus_exports.env

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

prometheus_exports.file

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

How to use

- hosts: server
  roles:
    - prometheus_exports

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) 2019 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.