services: Add irc-bot

This commit is contained in:
polyfloyd 2022-11-02 21:15:30 +01:00
parent 15472589a9
commit 8f02606c7b
4 changed files with 53 additions and 6 deletions

View file

@ -1,18 +1,18 @@
---
- import_tasks: ../../common/handlers/main.yaml
- name: restart irc-bot
systemd:
name: irc-bot
state: restarted
daemon_reload: true
- name: restart flipdot
systemd:
name: flipdot
state: restarted
daemon_reload: true
- name: restart irc-bot
systemd:
name: irc-bot
state: restarted
daemon_reload: true
- name: restart siahsd
systemd:
name: siahsd

View file

@ -0,0 +1,29 @@
---
- name: Clone source
git:
repo: https://github.com/bitlair/irc-bot.git
version: master
dest: /var/lib/irc-bot
accept_hostkey: yes
- name: Link irc-say
file:
state: link
src: /var/lib/irc-bot/irc-say
dest: /usr/local/bin/irc-say
- name: Install service file
template:
src: irc-bot.service
dest: /etc/systemd/system/irc-bot.service
owner: root
group: root
mode: 0644
notify: restart irc-bot
- name: Start irc-bot
systemd:
name: irc-bot
state: started
enabled: yes
daemon_reload: true

View file

@ -1,4 +1,7 @@
---
- tags: services_ircbot
import_tasks: ircbot.yaml
- tags: services_flipdot
import_tasks: flipdot.yaml

View file

@ -0,0 +1,15 @@
# Managed by Ansible
[Unit]
Description=Bitlair IRC bot
After=network.target
[Service]
Type=simple
ExecStart=/bin/bash /var/lib/irc-bot/irc-bot
Restart=on-failure
RestartSec=10s
DynamicUser=true
[Install]
WantedBy=multi-user.target