This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
hypervisors/ansible/roles/prometheus_agent/container-prometheus.service

19 lines
1.1 KiB
Desktop File

[Unit]
Description=Podman container-prometheus.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-prometheus.pid %t/container-prometheus.ctr-id
ExecStart=/usr/bin/podman run --network=host --conmon-pidfile %t/container-prometheus.pid --cidfile %t/container-prometheus.ctr-id --cgroups=no-conmon --replace --name prometheus -d -p 127.0.0.1:9100:9100 -p 9090:9090 -v /root/prometheus/data:/data/db:Z -v /root/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prometheus --enable-feature=agent --config.file=/etc/prometheus/prometheus.yml --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-prometheus.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-prometheus.ctr-id
PIDFile=%t/container-prometheus.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target