No description
- Python 64.8%
- Jinja 35.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| defaults | ||
| handlers | ||
| meta | ||
| molecule/default | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| .yamllint | ||
| CHANGELOG.md | ||
| LICENSE | ||
| README.md | ||
Ansible role: Prometheus
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
python3andpython3-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.