This commit is contained in:
parent
a5930bb1aa
commit
e65ffd5dc7
2 changed files with 10 additions and 12 deletions
|
@ -2,23 +2,14 @@
|
|||
|
||||
- name: Install dependencies
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- python3-paho-mqtt
|
||||
- python3-tz
|
||||
- virtualenv
|
||||
name: virtualenv
|
||||
|
||||
- name: Create virtualenv
|
||||
ansible.builtin.command:
|
||||
cmd: virtualenv /opt/miflora_exporter/.venv
|
||||
cmd: virtualenv /var/lib/discord-bot/.venv
|
||||
args:
|
||||
creates: /var/lib/discord-bot/.venv
|
||||
|
||||
- name: Install Python dependencies
|
||||
ansible.builtin.shell:
|
||||
cmd: . .venv/bin/activate && pip install -r requirements.txt
|
||||
args:
|
||||
chdir: /var/lib/discord-bot
|
||||
|
||||
- name: Clone source
|
||||
ansible.builtin.git:
|
||||
repo: https://git.bitlair.nl/bitlair/discord-bot.git
|
||||
|
@ -28,6 +19,12 @@
|
|||
notify: Restart discord-bot
|
||||
ignore_errors: true
|
||||
|
||||
- name: Install Python dependencies
|
||||
ansible.builtin.shell:
|
||||
cmd: . .venv/bin/activate && pip install -r requirements.txt
|
||||
args:
|
||||
chdir: /var/lib/discord-bot
|
||||
|
||||
- name: Install service file
|
||||
ansible.builtin.template:
|
||||
src: discord-bot.service
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Managed by Ansible
|
||||
# {{ ansible_managed }}
|
||||
|
||||
[Unit]
|
||||
Description=HobbyBot
|
||||
|
@ -13,6 +13,7 @@ DynamicUser=true
|
|||
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||
Environment="DISCORD_WEBHOOK_URL={{ lookup('passwordstore', 'services/discord', subkey='webhook_url') }}"
|
||||
Environment="DISCORD_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='token') }}"
|
||||
Environment="BOTTLECLIP_GIT_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='bottleclip_git_token') }}"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue