bank: Update inflatinator dependencies
This commit is contained in:
parent
55905adfa4
commit
e3683744fc
3 changed files with 33 additions and 3 deletions
roles
9
roles/bank/tasks/inflatinator.service
Normal file
9
roles/bank/tasks/inflatinator.service
Normal 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
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: [ links, python3-pyquery ]
|
name: virtualenv
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Clone revbank-inflatinator source
|
- name: Clone revbank-inflatinator source
|
||||||
|
@ -10,3 +10,24 @@
|
||||||
version: main
|
version: main
|
||||||
dest: /opt/revbank-inflatinator
|
dest: /opt/revbank-inflatinator
|
||||||
accept_hostkey: yes
|
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
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify:
|
notify:
|
||||||
- daemon reload
|
- Daemon reload
|
||||||
- restart mqtt_exporter
|
- restart mqtt_exporter
|
||||||
|
|
||||||
- name: Install config file
|
- name: Install config file
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify:
|
notify:
|
||||||
- daemon reload
|
- Daemon reload
|
||||||
- restart mqtt_exporter
|
- restart mqtt_exporter
|
||||||
|
|
||||||
- ansible.builtin.meta: flush_handlers
|
- ansible.builtin.meta: flush_handlers
|
||||||
|
|
Loading…
Add table
Reference in a new issue