28ea6ef2afdc00e5c71a2f97c84a1c8bf092d4aa
ansible-role-prometheus
Installs Prometheus from GitHub releases on Linux. Architecture is auto-detected. The role is idempotent: it only downloads and extracts when the version changes.
The service user and group must be created beforehand.
Prometheus configuration (prometheus.yml) is out of scope for this role.
Requirements
- Ansible >= 2.14
Role Variables
| Variable | Default | Description |
|---|---|---|
prometheus_version |
"" |
Version to install (empty = latest) |
prometheus_user |
prometheus |
User to run Prometheus |
prometheus_group |
prometheus |
Group to run Prometheus |
prometheus_install_dir |
/opt/prometheus |
Binary and assets directory |
prometheus_data_dir |
/var/lib/prometheus |
TSDB storage directory |
prometheus_config_dir |
/etc/prometheus |
Configuration directory |
prometheus_service_enabled |
true |
Enable service at boot |
prometheus_service_state |
started |
Service state after installation |
Example Playbook
- hosts: monitoring_servers
roles:
- role: ansible-role-prometheus
vars:
prometheus_user: prometheus
prometheus_group: prometheus
License
MIT
Description