Compare commits
2 commits
55905adfa4
...
ef6d87e3b1
Author | SHA1 | Date | |
---|---|---|---|
ef6d87e3b1 | |||
e3683744fc |
4 changed files with 35 additions and 5 deletions
|
@ -1,3 +1,3 @@
|
||||||
bank_user: bank
|
bank_user: bank
|
||||||
bank_revbank_git: https://github.com/revspace/revbank.git
|
bank_revbank_git: https://git.bitlair.nl/bitlair/revbank.git
|
||||||
bank_local_tty: no
|
bank_local_tty: no
|
||||||
|
|
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,12 +1,33 @@
|
||||||
---
|
---
|
||||||
- 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
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: https://github.com/bitlair/revbank-inflatinator.git
|
repo: https://git.bitlair.nl/bitlair/revbank-inflatinator.git
|
||||||
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