From 0b74fc2e7a8837b1499e472c4f826ed9e99c989b Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Sat, 6 Feb 2021 02:21:23 -0900 Subject: [PATCH] move firefly to role --- group_vars/all.yml | 10 ---------- nas.yml | 10 +++++----- roles/firefly/defaults/main.yml | 14 ++++++++++++++ tasks/firefly.yml => roles/firefly/tasks/main.yml | 7 +++++-- 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 roles/firefly/defaults/main.yml rename tasks/firefly.yml => roles/firefly/tasks/main.yml (90%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..47f7056d 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -54,9 +54,6 @@ gitlab_enabled: false znc_enabled: false thelounge_enabled: false -# Finance -firefly_enabled: false - # Wallabag wallabag_enabled: false @@ -450,13 +447,6 @@ thelounge_data_directory: "{{ docker_home }}/thelounge" thelounge_port_one: "113" thelounge_port_two: "9002" -### -### Firefly -### -firefly_available_externally: "false" -firefly_data_directory: "{{ docker_home }}/firefly" -firefly_port: "8066" - ### ### Nzbget ### diff --git a/nas.yml b/nas.yml index b3d30af3..7948ab84 100644 --- a/nas.yml +++ b/nas.yml @@ -83,6 +83,11 @@ - emby when: (emby_enabled | default(False)) + - role: firefly + tags: + - firefly + when: (firefly_enabled | default(False)) + - role: gitea tags: - gitea @@ -198,11 +203,6 @@ - watchtower when: (watchtower_enabled | default(False)) - tasks: - - import_tasks: tasks/firefly.yml - when: (firefly_enabled | default(False)) - tags: firefly - - import_tasks: tasks/tautulli.yml when: (tautulli_enabled | default(False)) tags: tautulli diff --git a/roles/firefly/defaults/main.yml b/roles/firefly/defaults/main.yml new file mode 100644 index 00000000..4722d2e7 --- /dev/null +++ b/roles/firefly/defaults/main.yml @@ -0,0 +1,14 @@ +--- +# enable or disable the application +firefly_enabled: false +firefly_available_externally: "false" + +# directories +firefly_data_directory: "{{ docker_home }}/firefly" + +# network +firefly_hostname: "firefly" +firefly_port: "8066" + +# specs +firefly_memory: "1g" diff --git a/tasks/firefly.yml b/roles/firefly/tasks/main.yml similarity index 90% rename from tasks/firefly.yml rename to roles/firefly/tasks/main.yml index 04516bd4..0a8843e5 100644 --- a/tasks/firefly.yml +++ b/roles/firefly/tasks/main.yml @@ -1,7 +1,9 @@ +--- - name: Create Firefly III Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ firefly_data_directory }}/postgresql" - "{{ firefly_data_directory }}/mysql" @@ -37,6 +39,7 @@ - "{{ firefly_data_directory }}/upload:/var/www/firefly-iii/storage/upload:rw" links: - firefly-mysql:db + network_mode: "bridge" ports: - "{{ firefly_port }}:8080" env: @@ -49,10 +52,10 @@ DB_PASSWORD: "firefly" TZ: "{{ ansible_nas_timezone }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ firefly_memory }}" labels: traefik.enable: "{{ firefly_available_externally }}" - traefik.http.routers.firefly.rule: "Host(`firefly.{{ ansible_nas_domain }}`)" + traefik.http.routers.firefly.rule: "Host(`{{ firefly_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.firefly.tls.certresolver: "letsencrypt" traefik.http.routers.firefly.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.firefly.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"