: add firefly3 role

This commit is contained in:
VC
2025-02-14 21:47:27 +01:00
parent 9d3035ac3c
commit 4e0b38822f
8 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
---
- name: Install firefly3 cron
ansible.builtin.cron:
user: www-data
name: firefly-iii-cron
minute: 0
hour: 3
job: "/usr/bin/php {{ firefly3_local_path }} firefly-iii:cron"

View File

@@ -0,0 +1,15 @@
---
- name: Create firefly3 db role
become_user: postgres
become: true
community.postgresql.postgresql_user:
name: "{{ firefly3_pg_role }}"
password: "{{ firefly3_pg_password }}"
- name: Create firefly3 db
become_user: postgres
become: true
community.postgresql.postgresql_db:
name: "{{ firefly3_pg_database }}"
owner: "{{ firefly3_pg_role }}"

View File

@@ -0,0 +1,40 @@
---
- name: Create application directory
ansible.builtin.file:
state: directory
dest: "{{ firefly3_local_path }}"
owner: root
group: www-data
mode: "0o750"
- name: Install firefly3 application
ansible.builtin.unarchive:
remote_src: true
src: "{{ firefly3_url }}"
dest: "{{ firefly3_local_path }}"
owner: root
group: www-data
mode: "a-rwx,u+rwX,g+rX"
exclude:
- ".env"
- name: Put config file
ansible.builtin.template:
src: "env.j2"
dest: "{{ firefly3_local_path }}/.env"
owner: root
group: www-data
mode: "0o640"
- name: Check writable dirs
ansible.builtin.file:
state: directory
dest: "{{ firefly3_local_path }}/{{ item }}"
owner: root
group: www-data
recurse: true
mode: "g+w"
loop:
- "bootstrap"
- "storage"

View File

@@ -0,0 +1,10 @@
---
- name: Init db
ansible.builtin.include_tasks: db.yml
- name: Install firefly3
ansible.builtin.include_tasks: firefly3.yml
- name: Install firefly3 cron
ansible.builtin.include_tasks: cron.yml