No description
  • Python 64.8%
  • Jinja 35.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adrien Waksberg 50e34e9880
All checks were successful
/ lint (push) Successful in 8s
/ molecule (push) Successful in 1m15s
first version
2026-07-24 16:04:15 +02:00
.forgejo/workflows first version 2026-07-24 16:04:15 +02:00
defaults first version 2026-07-24 16:04:15 +02:00
handlers first version 2026-07-24 16:04:15 +02:00
meta first version 2026-07-24 16:04:15 +02:00
molecule/default first version 2026-07-24 16:04:15 +02:00
tasks first version 2026-07-24 16:04:15 +02:00
templates first version 2026-07-24 16:04:15 +02:00
.gitignore first version 2026-07-24 16:04:15 +02:00
.yamllint first version 2026-07-24 16:04:15 +02:00
CHANGELOG.md first version 2026-07-24 16:04:15 +02:00
LICENSE first version 2026-07-24 16:04:15 +02:00
README.md first version 2026-07-24 16:04:15 +02:00

Ansible role: Prometheus

Version License Build

Install and configure Prometheus

Requirements

  • Ansible >= 2.21
  • Debian
    • Trixie

Role variables

Name Type Required Default Comment
prometheus_version str no 3.5.4 prometheus version to install
prometheus_checksum str no sha256:be64e1cf657e6e7d132aca022f6135abedd660db053952e3f69e8affa3b9cc9e checksum of prometheus binary
prometheus_gid int no 2000 gid of prometheus group used to run service
prometheus_uid int no 2000 uid of prometheus user used to run service
prometheus_data_dir str no /var/lib/prometheus-server folder for prometheus data
prometheus_args list no Prometheus launcher's arguments 
prometheus_config dict no Prometheus general config 
prometheus_web_config dict no Prometheus web config 

prometheus_config

Prometheus general config, see documentation for all parameters

scrape_configs:
  - job_name: prometheus
    scrape_interval: 5s
    scrape_timeout: 5s
    static_configs:
      - targets: ["localhost:9090"]

prometheus_web_config

Prometheus web config, see documentation for all parameters

http_server_config:
  http2: true

How to use

- hosts: monitoring
  roles:
    - nishiki.prometheus
  vars:
    prometheus_version: "3.5.4"
    prometheus_checksum: "sha256:be64e1cf657e6e7d132aca022f6135abedd660db053952e3f69e8affa3b9cc9e"
    prometheus_gid: 2000
    prometheus_uid: 2000
    prometheus_data_dir: "/var/lib/prometheus-server"
    prometheus_args:
      - "--storage.tsdb.retention.time=180d"
    prometheus_config:
    scrape_configs:
      - job_name: prometheus
        scrape_interval: 5s
        scrape_timeout: 5s
        static_configs:
          - targets: ["localhost:9090"]

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.