ansible/roles/services/tasks/ircbot.yaml

96 lines
2.2 KiB
YAML

---
- name: Clone source
ansible.builtin.git:
repo: https://github.com/bitlair/irc-bot.git
version: master
dest: /var/lib/irc-bot
accept_hostkey: yes
notify: restart irc-bot
- name: Link irc-say
ansible.builtin.file:
state: link
src: /var/lib/irc-bot/irc-say
dest: /usr/local/bin/irc-say
- name: Install service file
ansible.builtin.template:
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
ansible.builtin.systemd:
name: irc-bot
state: started
enabled: yes
daemon_reload: true
- name: Create helpers dir
ansible.builtin.file:
path: /var/lib/irc-helpers
state: directory
- name: Install photos notification
ansible.builtin.template:
src: irc-photos.sh
dest: /var/lib/irc-helpers/photos.sh
owner: root
group: root
mode: 0755
notify: restart irc-photos
- name: Install photos notification service
ansible.builtin.template:
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
ansible.builtin.systemd:
name: irc-photos
state: started
enabled: yes
daemon_reload: true
- name: Install doorduino notification
ansible.builtin.template:
src: irc-doorduino.sh
dest: /var/lib/irc-helpers/doorduino.sh
owner: root
group: root
mode: 0755
notify: restart irc-doorduino
- name: Install doorduino notification service
ansible.builtin.template:
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
ansible.builtin.systemd:
name: irc-doorduino
state: started
enabled: yes
daemon_reload: true