forked from bitlair/ansible
services: Merge some service templates
This commit is contained in:
parent
051eef5bbf
commit
4c8fae0657
6 changed files with 23 additions and 53 deletions
|
@ -15,11 +15,14 @@
|
||||||
|
|
||||||
- name: Install service file
|
- name: Install service file
|
||||||
template:
|
template:
|
||||||
src: irc-bot.service
|
src: generic.service
|
||||||
dest: /etc/systemd/system/irc-bot.service
|
dest: /etc/systemd/system/irc-bot.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
vars:
|
||||||
|
description: Bitlair IRC bot
|
||||||
|
exec: /bin/bash /var/lib/irc-bot/irc-bot
|
||||||
notify: restart irc-bot
|
notify: restart irc-bot
|
||||||
|
|
||||||
- name: Start irc-bot
|
- name: Start irc-bot
|
||||||
|
@ -45,11 +48,15 @@
|
||||||
|
|
||||||
- name: Install photos notification service
|
- name: Install photos notification service
|
||||||
template:
|
template:
|
||||||
src: irc-photos.service
|
src: generic.service
|
||||||
dest: /etc/systemd/system/irc-photos.service
|
dest: /etc/systemd/system/irc-photos.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
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
|
notify: restart irc-photos
|
||||||
|
|
||||||
- name: Start irc-photos
|
- name: Start irc-photos
|
||||||
|
@ -70,11 +77,15 @@
|
||||||
|
|
||||||
- name: Install doorduino notification service
|
- name: Install doorduino notification service
|
||||||
template:
|
template:
|
||||||
src: irc-doorduino.service
|
src: generic.service
|
||||||
dest: /etc/systemd/system/irc-doorduino.service
|
dest: /etc/systemd/system/irc-doorduino.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
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
|
notify: restart irc-doorduino
|
||||||
|
|
||||||
- name: Start irc-doorduino
|
- name: Start irc-doorduino
|
||||||
|
|
|
@ -14,11 +14,14 @@
|
||||||
|
|
||||||
- name: Install power-mqtt service
|
- name: Install power-mqtt service
|
||||||
template:
|
template:
|
||||||
src: power-mqtt.service
|
src: generic.service
|
||||||
dest: /etc/systemd/system/power-mqtt.service
|
dest: /etc/systemd/system/power-mqtt.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
vars:
|
||||||
|
description: SMD630 to MQTT Probe
|
||||||
|
exec: /var/lib/power-mqtt.py
|
||||||
notify: restart power-mqtt
|
notify: restart power-mqtt
|
||||||
|
|
||||||
- name: Start power-mqtt
|
- name: Start power-mqtt
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
# Managed by Ansible
|
# Managed by Ansible
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Bitlair IRC bot
|
Description={{ description }}
|
||||||
After=network.target
|
After=network.target
|
||||||
|
{% if requires|default('') %}
|
||||||
|
Requires={{ requires }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/bin/bash /var/lib/irc-bot/irc-bot
|
ExecStart={{ exec }}
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
DynamicUser=true
|
DynamicUser=true
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
Loading…
Add table
Reference in a new issue