ansible/roles/services/tasks/discord_bot.yaml

31 lines
664 B
YAML

---
- name: Install dependencies
apt:
name:
- python3-paho-mqtt
- python3-tz
# Not in apt, install manually: discord.py, discord_webhook
- name: Clone source
git:
repo: https://github.com/bitlair/discord-bot.git
version: main
dest: /var/lib/discord-bot
accept_hostkey: yes
notify: restart discord-bot
- name: Install service file
template:
src: discord-bot.service
dest: /etc/systemd/system/discord-bot.service
owner: root
group: root
mode: 0644
notify: restart discord-bot
- name: Start discord-bot
systemd:
name: discord-bot
state: started
enabled: yes
daemon_reload: true