♻: move oolatoocs to a dedicated role

This commit is contained in:
VC
2025-02-14 20:56:33 +01:00
parent 62d829e92c
commit 0b935313c1
4 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
---
- name: Create the directory for oolatoocs
ansible.builtin.file:
name: "{{ oolatoocs_db_dir }}"
state: directory
owner: www-data
group: www-data
mode: "0o755"
- name: Download oolatoocs exec
ansible.builtin.get_url:
url: "{{ oolatoocs_url }}.{{ oolatoocs_version }}"
dest: "{{ oolatoocs_local_bin_path }}"
owner: root
group: root
mode: "0o755"
- name: Put conf file
ansible.builtin.template:
src: oolatoocs.toml.j2
dest: /usr/local/etc/oolatoocs.toml
owner: www-data
group: www-data
mode: "0o640"
- name: Init oolatoocs DB
ansible.builtin.command:
cmd: "{{ oolatoocs_local_bin_path }} init"
creates: "{{ oolatoocs_db_dir }}/db"
- name: Migrate oolatoocs DB
ansible.builtin.command:
cmd: "{{ oolatoocs_local_bin_path }} migrate"
changed_when: false
- name: Cron for oolatoocs
ansible.builtin.cron:
name: Oolatoocs
user: www-data
minute: "*/5"
job: "{{ oolatoocs_local_bin_path }}"