feat: Add Prometheus installation role and playbook
- Created Prometheus role with automated installation - Version: 2.48.1 - Configured remote_write to VictoriaMetrics (192.168.0.104:8428) - Added scrape configs for monitoring infrastructure - Created systemd service configuration - Successfully tested on 192.168.0.105
This commit is contained in:
29
roles/prometheus/templates/prometheus.service.j2
Normal file
29
roles/prometheus/templates/prometheus.service.j2
Normal file
@ -0,0 +1,29 @@
|
||||
[Unit]
|
||||
Description=Prometheus Monitoring System
|
||||
Documentation=https://prometheus.io/docs/
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
User={{ prometheus_user }}
|
||||
Group={{ prometheus_group }}
|
||||
Type=simple
|
||||
ExecStart={{ prometheus_binary_dir }}/prometheus \
|
||||
--config.file={{ prometheus_config_dir }}/prometheus.yml \
|
||||
--storage.tsdb.path={{ prometheus_data_dir }} \
|
||||
--storage.tsdb.retention.time={{ prometheus_retention }} \
|
||||
--web.console.templates={{ prometheus_config_dir }}/consoles \
|
||||
--web.console.libraries={{ prometheus_config_dir }}/console_libraries \
|
||||
--web.enable-lifecycle \
|
||||
--web.enable-admin-api \
|
||||
--log.level={{ prometheus_log_level }}
|
||||
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=prometheus
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user