add prometheus role

This commit is contained in:
Sergey Malyuk
2025-12-12 11:44:47 +03:00
parent b9e84279ce
commit cb4f2672ca
23 changed files with 407 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
Documentation="https://prometheus.io/"
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file {{ config_dir }}/prometheus.yml \
--storage.tsdb.path {{ db_dir }} \
--storage.tsdb.retention.time=30d
# Security hardening
ReadWritePaths={{ db_dir }}
ProtectSystem=strict
NoNewPrivileges=true
PrivateTmp=true
ProtectKernelModules=true
ProtectControlGroups=true
ProtectKernelTunables=true
ProtectClock=yes
RestrictSUIDSGID=true
[Install]
WantedBy=multi-user.target