services: Merge some service templates

This commit is contained in:
polyfloyd 2024-04-14 13:57:42 +02:00
parent 051eef5bbf
commit 4c8fae0657
6 changed files with 23 additions and 53 deletions

View file

@ -15,11 +15,14 @@
- name: Install service file
template:
src: irc-bot.service
src: generic.service
dest: /etc/systemd/system/irc-bot.service
owner: root
group: root
mode: 0644
vars:
description: Bitlair IRC bot
exec: /bin/bash /var/lib/irc-bot/irc-bot
notify: restart irc-bot
- name: Start irc-bot
@ -45,11 +48,15 @@
- name: Install photos notification service
template:
src: irc-photos.service
src: generic.service
dest: /etc/systemd/system/irc-photos.service
owner: root
group: root
mode: 0644
vars:
description: Bitlair IRC photos notification
requires: irc-bot.service
exec: /bin/bash /var/lib/irc-helpers/photos.sh
notify: restart irc-photos
- name: Start irc-photos
@ -70,11 +77,15 @@
- name: Install doorduino notification service
template:
src: irc-doorduino.service
src: generic.service
dest: /etc/systemd/system/irc-doorduino.service
owner: root
group: root
mode: 0644
vars:
description: Bitlair IRC doorduino notification
requires: irc-bot.service
exec: /bin/bash /var/lib/irc-helpers/doorduino.sh
notify: restart irc-doorduino
- name: Start irc-doorduino

View file

@ -14,11 +14,14 @@
- name: Install power-mqtt service
template:
src: power-mqtt.service
src: generic.service
dest: /etc/systemd/system/power-mqtt.service
owner: root
group: root
mode: 0644
vars:
description: SMD630 to MQTT Probe
exec: /var/lib/power-mqtt.py
notify: restart power-mqtt
- name: Start power-mqtt

View file

@ -1,12 +1,15 @@
# Managed by Ansible
[Unit]
Description=Bitlair IRC bot
Description={{ description }}
After=network.target
{% if requires|default('') %}
Requires={{ requires }}
{% endif %}
[Service]
Type=simple
ExecStart=/bin/bash /var/lib/irc-bot/irc-bot
ExecStart={{ exec }}
Restart=always
RestartSec=10s
DynamicUser=true

View file

@ -1,16 +0,0 @@
# Managed by Ansible
[Unit]
Description=Bitlair IRC doorduino notification
After=network.target
Requires=irc-bot.service
[Service]
Type=simple
ExecStart=/bin/bash /var/lib/irc-helpers/doorduino.sh
Restart=always
RestartSec=10s
DynamicUser=true
[Install]
WantedBy=multi-user.target

View file

@ -1,16 +0,0 @@
# Managed by Ansible
[Unit]
Description=Bitlair IRC photos notification
After=network.target
Requires=irc-bot.service
[Service]
Type=simple
ExecStart=/bin/bash /var/lib/irc-helpers/photos.sh
Restart=always
RestartSec=10s
DynamicUser=true
[Install]
WantedBy=multi-user.target

View file

@ -1,15 +0,0 @@
# Managed by Ansible
[Unit]
Description=SMD630 to MQTT Probe
After=network.target
[Service]
Type=simple
ExecStart=/var/lib/power-mqtt.py
Restart=on-failure
RestartSec=10s
DynamicUser=true
[Install]
WantedBy=multi-user.target