♻: move oolatoocs to a dedicated role
This commit is contained in:
@@ -7,3 +7,4 @@
|
||||
- nodejs
|
||||
- redis
|
||||
- mastodon
|
||||
- oolatoocs
|
||||
|
42
roles/oolatoocs/tasks/main.yml
Normal file
42
roles/oolatoocs/tasks/main.yml
Normal 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 }}"
|
14
roles/oolatoocs/templates/oolatoocs.toml.j2
Normal file
14
roles/oolatoocs/templates/oolatoocs.toml.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
[oolatoocs]
|
||||
db_path = "{{ oolatoocs_db_dir }}/db"
|
||||
|
||||
[mastodon]
|
||||
base = "https://m.nintendojo.fr"
|
||||
client_id = "{{ oolatoocs_mastodon_client_id }}"
|
||||
client_secret = "{{ oolatoocs_mastodon_client_secret }}"
|
||||
redirect = "urn:ietf:wg:oauth:2.0:oob"
|
||||
token = "{{ oolatoocs_mastodon_token }}"
|
||||
|
||||
[bluesky]
|
||||
handle = "nintendojofr.bsky.social"
|
||||
password = "{{ oolatoocs_bluesky_password }}"
|
||||
config_path = "{{ oolatoocs_db_dir }}/bsky.json"
|
6
roles/oolatoocs/vars/main.yml
Normal file
6
roles/oolatoocs/vars/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
oolatoocs_db_dir: /var/lib/oolatoocs
|
||||
oolatoocs_url: https://r.mateu.be/oolatoocs/oolatoocs
|
||||
oolatoocs_version: v4.2.0
|
||||
oolatoocs_local_bin_path: /usr/local/bin/oolatoocs
|
Reference in New Issue
Block a user