From c9e51f3f0479d6d754f7fbe9b6197b4976aea6cb Mon Sep 17 00:00:00 2001 From: moanos Date: Sat, 27 Apr 2024 08:27:28 +0200 Subject: [PATCH] feat: Add basic paperless support --- templates/group_vars_mash_servers | 65 +++++++++++++++++++++++++++++++ templates/requirements.yml | 3 ++ templates/setup.yml | 4 ++ 3 files changed, 72 insertions(+) diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index f04eb29..645f70d 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -463,6 +463,11 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized: {{ ({'name': (oxitraffic_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'oxitraffic']} if oxitraffic_enabled else omit) }} # /role-specific:oxitraffic + # role-specific:paperless + - |- + {{ ({'name': (paperless_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'paperless']} if paperless_enabled else omit) }} + # /role-specific:paperless + # role-specific:peertube - |- {{ ({'name': (peertube_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'peertube']} if peertube_enabled else omit) }} @@ -841,6 +846,18 @@ mash_playbook_devture_postgres_managed_databases_auto_itemized: }} # /role-specific:oxitraffic + + # role-specific:paperless + - |- + {{ + ({ + 'name': paperless_database_name, + 'username': paperless_database_username, + 'password': paperless_database_password, + } if paperless_enabled and paperless_database_hostname == devture_postgres_identifier else omit) + }} + # /role-specific:paperless + # role-specific:peertube - |- {{ @@ -3955,6 +3972,54 @@ oxitraffic_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certRe # /role-specific:oxitraffic +# role-specific:paperless +######################################################################## +# # +# paperless # +# # +######################################################################## + +paperless_enabled: false + +paperless_identifier: "{{ mash_playbook_service_identifier_prefix }}paperless" + +paperless_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}paperless" + +paperless_uid: "{{ mash_playbook_uid }}" +paperless_gid: "{{ mash_playbook_gid }}" + +paperless_database_hostname: "{{ devture_postgres_identifier if devture_postgres_enabled else '' }}" +paperless_database_username: "paperless" +paperless_database_port: "{{ '5432' if devture_postgres_enabled else '' }}" +paperless_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.paperless', rounds=655555) | to_uuid }}" + +paperless_systemd_required_services_list: | + {{ + (['docker.service']) + + + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled and paperless_database_hostname == devture_postgres_identifier else []) + }} + +paperless_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([devture_postgres_container_network] if devture_postgres_enabled and paperless_database_hostname == devture_postgres_identifier and paperless_container_network != devture_postgres_container_network else []) + }} + +paperless_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +paperless_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +paperless_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +paperless_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +######################################################################## +# # +# /paperless # +# # +######################################################################## +# /role-specific:paperless + + # role-specific:peertube ######################################################################## diff --git a/templates/requirements.yml b/templates/requirements.yml index b9472a7..db25c92 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -228,6 +228,9 @@ version: v0.9.0-0 name: oxitraffic activation_prefix: oxitraffic_ +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-paperless.git + version: v2.7.2-0 + name: paperless - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-peertube.git version: v6.0.4-0 name: peertube diff --git a/templates/setup.yml b/templates/setup.yml index a004809..c0f5e32 100644 --- a/templates/setup.yml +++ b/templates/setup.yml @@ -290,6 +290,10 @@ - role: galaxy/oxitraffic # /role-specific:oxitraffic + # role-specific:paperless + - role: galaxy/paperless + # /role-specific:paperless + # role-specific:peertube - role: galaxy/peertube # /role-specific:peertube