bank: Update inflatinator dependencies

This commit is contained in:
polyfloyd 2024-12-22 18:14:16 +01:00
parent 55905adfa4
commit e3683744fc
3 changed files with 33 additions and 3 deletions

View file

@ -0,0 +1,9 @@
[Unit]
Description=Update product prices in Revbank
[Service]
Type=oneshot
ExecStart=/opt/revbank-inflatinator/.venv/bin/python /opt/revbank-inflatinator/inflatinator/ /home/bank/revbank.products
EnvironmentFile=/etc/revbank-inflatinator/env.conf
User=bank
Group=bank

View file

@ -1,7 +1,7 @@
---
- name: Install dependencies
ansible.builtin.apt:
name: [ links, python3-pyquery ]
name: virtualenv
state: present
- name: Clone revbank-inflatinator source
@ -10,3 +10,24 @@
version: main
dest: /opt/revbank-inflatinator
accept_hostkey: yes
- name: Create virtualenv
ansible.builtin.command:
cmd: virtualenv /opt/revbank-inflatinator/.venv
args:
creates: /opt/revbank-inflatinator/.venv
- name: Install Python dependencies
ansible.builtin.shell:
cmd: . .venv/bin/activate && pip install -r requirements.txt
args:
chdir: /opt/revbank-inflatinator
- name: Install service
ansible.builtin.template:
src: inflatinator.service
dest: /etc/systemd/system/revbank-inflatinator.service
owner: root
group: root
mode: 0644
notify: Daemon reload

View file

@ -24,7 +24,7 @@
group: root
mode: 0644
notify:
- daemon reload
- Daemon reload
- restart mqtt_exporter
- name: Install config file
@ -35,7 +35,7 @@
group: root
mode: 0644
notify:
- daemon reload
- Daemon reload
- restart mqtt_exporter
- ansible.builtin.meta: flush_handlers