1
0
Fork 0

improve systemd workflow

This commit is contained in:
L3D 2022-11-22 17:43:34 +01:00
parent 125a2823d2
commit b8c301413d
No known key found for this signature in database
GPG key ID: 5215C3441797AB2B
3 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,6 @@
--- ---
- name: Systemctl restart ping_exporter.service - name: Systemctl restart ping_exporter.service
ansible.builtin.debug: become: true
msg: "in progress..." ansible.builtin.systemd:
name: 'ping_exporter.service'
state: 'restarted'

View file

@ -1,11 +1,15 @@
# {{ ansible_managed }} {{ ansible_managed | comment }}
[Unit] [Unit]
Description=Execute the ping_exporter server. Description=Execute the ping_exporter server.
[Service] [Service]
Type=simple
WorkingDirectory={{ ping_exporter__user_home }} WorkingDirectory={{ ping_exporter__user_home }}
User={{ ping_exporter__user }}
Group={{ ping_exporter__group }}
ExecStart=/usr/bin/ping_exporter --config.path {{ ping_exporter__user_home }}/ping_exporter_config.yml ExecStart=/usr/bin/ping_exporter --config.path {{ ping_exporter__user_home }}/ping_exporter_config.yml
AmbientCapabilities=CAP_NET_RAW
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -3,5 +3,5 @@ ping_exporter__repo: 'https://github.com/czerwonk/ping_exporter.git'
ping_exporter__repo_api: 'https://api.github.com/repos/czerwonk/ping_exporter/releases/latest' ping_exporter__repo_api: 'https://api.github.com/repos/czerwonk/ping_exporter/releases/latest'
# versionscheck # versionscheck
playbook_version_number: 03 # should be a integer playbook_version_number: 04 # should be a integer
playbook_version_path: 'do1jlr.prometheus_ping_exporter.version' playbook_version_path: 'do1jlr.prometheus_ping_exporter.version'