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
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name: virtualenv
|
||||||
- python3-paho-mqtt
|
|
||||||
- python3-tz
|
|
||||||
- virtualenv
|
|
||||||
|
|
||||||
- name: Create virtualenv
|
- name: Create virtualenv
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: virtualenv /opt/miflora_exporter/.venv
|
cmd: virtualenv /var/lib/discord-bot/.venv
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/discord-bot/.venv
|
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
|
- name: Clone source
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: https://git.bitlair.nl/bitlair/discord-bot.git
|
repo: https://git.bitlair.nl/bitlair/discord-bot.git
|
||||||
|
@ -28,6 +19,12 @@
|
||||||
notify: Restart discord-bot
|
notify: Restart discord-bot
|
||||||
ignore_errors: true
|
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
|
- name: Install service file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: discord-bot.service
|
src: discord-bot.service
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=HobbyBot
|
Description=HobbyBot
|
||||||
|
@ -13,6 +13,7 @@ DynamicUser=true
|
||||||
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||||
Environment="DISCORD_WEBHOOK_URL={{ lookup('passwordstore', 'services/discord', subkey='webhook_url') }}"
|
Environment="DISCORD_WEBHOOK_URL={{ lookup('passwordstore', 'services/discord', subkey='webhook_url') }}"
|
||||||
Environment="DISCORD_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='token') }}"
|
Environment="DISCORD_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='token') }}"
|
||||||
|
Environment="BOTTLECLIP_GIT_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='bottleclip_git_token') }}"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue