Initial commit
This commit is contained in:
commit
19bd75c78c
19
.editorconfig
Normal file
19
.editorconfig
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# EditorConfig: http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Defaults for all editor files
|
||||||
|
[*]
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
# Files with a smaller indent
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Jinja2 template files
|
||||||
|
[*.j2]
|
||||||
|
end_of_line = lf
|
20
.gitignore
vendored
Normal file
20
.gitignore
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local-configure.yml
|
||||||
|
.vagrant/
|
||||||
|
docs/_build/
|
||||||
|
roles/plone.plone_server
|
||||||
|
roles/jnv.unattended-upgrades
|
||||||
|
roles/tersmitten.fail2ban
|
||||||
|
roles/ANXS.hostname
|
||||||
|
roles/ANXS.apt
|
||||||
|
._*
|
||||||
|
bin/
|
||||||
|
lib/
|
||||||
|
include/
|
||||||
|
local/
|
||||||
|
tests.out
|
||||||
|
*.retry
|
||||||
|
*.log
|
||||||
|
vbox_host.cfg
|
||||||
|
.DS_Store
|
||||||
|
*.py[co]
|
||||||
|
.idea/
|
56
README.md
Normal file
56
README.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# EditorConfig: http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Defaults for all editor files
|
||||||
|
[*]
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
# Files with a smaller indent
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Jinja2 template files
|
||||||
|
[*.j2]
|
||||||
|
end_of_line = lfRole Name
|
||||||
|
=========
|
||||||
|
|
||||||
|
A brief description of the role goes here.
|
||||||
|
|
||||||
|
Requirements
|
||||||
|
------------
|
||||||
|
|
||||||
|
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
|
||||||
|
|
||||||
|
Role Variables
|
||||||
|
--------------
|
||||||
|
|
||||||
|
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
|
||||||
|
|
||||||
|
Dependencies
|
||||||
|
------------
|
||||||
|
|
||||||
|
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
|
||||||
|
|
||||||
|
Example Playbook
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
|
||||||
|
|
||||||
|
- hosts: servers
|
||||||
|
roles:
|
||||||
|
- { role: username.rolename, x: 42 }
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
|
BSD
|
||||||
|
|
||||||
|
Author Information
|
||||||
|
------------------
|
||||||
|
|
||||||
|
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
|
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[defaults]
|
||||||
|
roles_path: ./../
|
9
defaults/main.yml
Normal file
9
defaults/main.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
paperless_ngx_version: "1.17"
|
||||||
|
paperless_ngx_redis_version: "7"
|
||||||
|
paperless_ngx_postgres_version: "16"
|
||||||
|
paperless_ngx_gotenberg_version: "7.8"
|
||||||
|
|
||||||
|
paperless_ngx_url: ""
|
||||||
|
|
||||||
|
paperless_barcode_enable: true
|
4
handlers/main.yml
Normal file
4
handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- name: "Restart Paperless"
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: paperless-ngx
|
||||||
|
state: restarted
|
54
meta/main.yml
Normal file
54
meta/main.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
galaxy_info:
|
||||||
|
author: your name
|
||||||
|
description: your role description
|
||||||
|
company: your company (optional)
|
||||||
|
|
||||||
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
|
# next line and provide a value
|
||||||
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|
||||||
|
# Choose a valid license ID from https://spdx.org - some suggested licenses:
|
||||||
|
# - BSD-3-Clause (default)
|
||||||
|
# - MIT
|
||||||
|
# - GPL-2.0-or-later
|
||||||
|
# - GPL-3.0-only
|
||||||
|
# - Apache-2.0
|
||||||
|
# - CC-BY-4.0
|
||||||
|
license: None
|
||||||
|
|
||||||
|
min_ansible_version: 2.1
|
||||||
|
|
||||||
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
|
# min_ansible_container_version:
|
||||||
|
|
||||||
|
#
|
||||||
|
# Provide a list of supported platforms, and for each platform a list of versions.
|
||||||
|
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
|
||||||
|
# To view available platforms and versions (or releases), visit:
|
||||||
|
# https://galaxy.ansible.com/api/v1/platforms/
|
||||||
|
#
|
||||||
|
# platforms:
|
||||||
|
# - name: Fedora
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 25
|
||||||
|
# - name: SomePlatform
|
||||||
|
# versions:
|
||||||
|
# - all
|
||||||
|
# - 1.0
|
||||||
|
# - 7
|
||||||
|
# - 99.99
|
||||||
|
|
||||||
|
galaxy_tags: [
|
||||||
|
- paperless-ngx
|
||||||
|
]
|
||||||
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||||
|
# remove the '[]' above, if you add tags to this list.
|
||||||
|
#
|
||||||
|
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||||
|
# Maximum 20 tags per role.
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
|
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
|
||||||
|
# if you add dependencies to this list.
|
2
meta/requirements.yml
Normal file
2
meta/requirements.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- name: role-traefik
|
||||||
|
src: https://git.dragse.it/ansible/role-traefik
|
70
tasks/main.yml
Normal file
70
tasks/main.yml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
- name: Create podman folder
|
||||||
|
file:
|
||||||
|
path: /etc/containers/systemd
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless data folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/data"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless media folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/media"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless export folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/export"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless consume folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/consume"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless redis folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/redis"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Create paperless postgres folder
|
||||||
|
file:
|
||||||
|
path: "/var/paperless-ngx/postgres"
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
recurse: yes
|
||||||
|
|
||||||
|
- name: Setup Podman quadlet
|
||||||
|
block:
|
||||||
|
- name: Copy vaultwarden.container
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: vaultwarden.quadlet.j2
|
||||||
|
dest: "/etc/containers/systemd/vaultwarden-{{ vaultwarden_identifier }}.container"
|
||||||
|
|
||||||
|
- name: "Reload systemd"
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
daemon_reload: true
|
||||||
|
when: ansible_service_mgr == "systemd"
|
||||||
|
|
||||||
|
- name: Start Vaultwardne
|
||||||
|
systemd_service:
|
||||||
|
enabled: true
|
||||||
|
name: vaultwarden-{{ vaultwarden_identifier }}
|
||||||
|
state: started
|
||||||
|
notify:
|
||||||
|
- Restart Vaultwarden
|
||||||
|
|
30
templates/paperless-ngx-gotenberg.quadlet.j2
Normal file
30
templates/paperless-ngx-gotenberg.quadlet.j2
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Paperless-ngx Gotenberg
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=paperless-ngx-gotenberg
|
||||||
|
Image=docker.io/gotenberg/gotenberg:{{ paperless_ngx_gotenberg_version }}
|
||||||
|
|
||||||
|
Network=paperless.network
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
DropCapability=All
|
||||||
|
|
||||||
|
#UserNS=keep-id
|
||||||
|
# Required to access the Podman Socket
|
||||||
|
#SecurityLabelDisable=true
|
||||||
|
PodmanArgs=--userns=keep-id --security-opt label=disable
|
||||||
|
|
||||||
|
Exec=gotenberg --chromium-disable-javascript=true --chromium-allow-list=file:///tmp/.*
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
# Restart Delay
|
||||||
|
RestartSec=30
|
||||||
|
# Allowed time for the service to start.
|
||||||
|
TimeoutStartSec=90
|
||||||
|
# Allowed time for the service to stop.
|
||||||
|
TimeoutStopSec=90
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
36
templates/paperless-ngx-postgres.quadlet.j2
Normal file
36
templates/paperless-ngx-postgres.quadlet.j2
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Paperless-ngx Postgres
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=paperless-ngx-postgres
|
||||||
|
Image=docker.io/library/postgres:{{ paperless_ngx_postgres_version }}
|
||||||
|
|
||||||
|
Environment=TZ=Europe/Berlin
|
||||||
|
Environment=POSTGRES_USER=paperless
|
||||||
|
Environment=POSTGRES_PASSWORD=paperless
|
||||||
|
Environment=POSTGRES_DB=paperless
|
||||||
|
|
||||||
|
Network=paperless.network
|
||||||
|
|
||||||
|
Volume=/var/paperless-ngx/postgres:/var/lib/postgresql/data:rw
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
DropCapability=All
|
||||||
|
AddCapability=net_bind_service
|
||||||
|
|
||||||
|
#UserNS=keep-id
|
||||||
|
# Required to access the Podman Socket
|
||||||
|
#SecurityLabelDisable=true
|
||||||
|
PodmanArgs=--userns=keep-id --security-opt label=disable
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
# Restart Delay
|
||||||
|
RestartSec=30
|
||||||
|
# Allowed time for the service to start.
|
||||||
|
TimeoutStartSec=90
|
||||||
|
# Allowed time for the service to stop.
|
||||||
|
TimeoutStopSec=90
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
31
templates/paperless-ngx-redis.quadlet.j2
Normal file
31
templates/paperless-ngx-redis.quadlet.j2
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Paperless-ngx Redis
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=paperless-ngx-redis
|
||||||
|
Image=docker.io/library/redis:{{ paperless_ngx_redis_version }}
|
||||||
|
|
||||||
|
Network=paperless.network
|
||||||
|
|
||||||
|
Volume=/var/paperless-ngx/redis:/data:rw
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
DropCapability=All
|
||||||
|
AddCapability=net_bind_service
|
||||||
|
|
||||||
|
#UserNS=keep-id
|
||||||
|
# Required to access the Podman Socket
|
||||||
|
#SecurityLabelDisable=true
|
||||||
|
PodmanArgs=--userns=keep-id --security-opt label=disable
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
# Restart Delay
|
||||||
|
RestartSec=30
|
||||||
|
# Allowed time for the service to start.
|
||||||
|
TimeoutStartSec=90
|
||||||
|
# Allowed time for the service to stop.
|
||||||
|
TimeoutStopSec=90
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
28
templates/paperless-ngx-tika.quadlet.j2
Normal file
28
templates/paperless-ngx-tika.quadlet.j2
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Paperless-ngx Tika
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=paperless-ngx-tika
|
||||||
|
Image=ghcr.io/paperless-ngx/tika:latest
|
||||||
|
|
||||||
|
Network=paperless.network
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
DropCapability=All
|
||||||
|
|
||||||
|
#UserNS=keep-id
|
||||||
|
# Required to access the Podman Socket
|
||||||
|
#SecurityLabelDisable=true
|
||||||
|
PodmanArgs=--userns=keep-id --security-opt label=disable
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
# Restart Delay
|
||||||
|
RestartSec=30
|
||||||
|
# Allowed time for the service to start.
|
||||||
|
TimeoutStartSec=90
|
||||||
|
# Allowed time for the service to stop.
|
||||||
|
TimeoutStopSec=90
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
75
templates/paperless-ngx.quadlet.j2
Normal file
75
templates/paperless-ngx.quadlet.j2
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Paperless-ngx
|
||||||
|
Requires=paperless-ngx-postgres.service
|
||||||
|
Requires=paperless-ngx-redis.service
|
||||||
|
Requires=paperless-ngx-tika.service
|
||||||
|
Requires=paperless-ngx-gotenberg.service
|
||||||
|
After=paperless-ngx-postgres.service
|
||||||
|
After=paperless-ngx-redis.service
|
||||||
|
After=paperless-ngx-tika.service
|
||||||
|
After=paperless-ngx-gotenberg.service
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
ContainerName=paperless-ngx
|
||||||
|
Image=ghcr.io/paperless-ngx/paperless-ngx:{{ paperless_ngx_version }}
|
||||||
|
|
||||||
|
Environment=PAPERLESS_SECRET_KEY={{ paperless_secret_key }}
|
||||||
|
Environment=TZ=Europe/Berlin
|
||||||
|
Environment=PAPERLESS_TIME_ZONE=Europe/Berlin
|
||||||
|
Environment=PAPERLESS_OCR_LANGUAGE=deu+eng
|
||||||
|
Environment=PAPERLESS_URL=https://{{ paperless_ngx_url }}
|
||||||
|
|
||||||
|
Environment=PAPERLESS_TIKA_ENABLED=1
|
||||||
|
Environment=PAPERLESS_TIKA_ENDPOINT=http://paperless-ngx-tika:9998
|
||||||
|
Environment=PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://paperless-ngx-gotenberg:3000
|
||||||
|
|
||||||
|
Environment=PAPERLESS_DBENGINE=postgresql
|
||||||
|
Environment=PAPERLESS_DBHOST=paperless-ngx-postgres
|
||||||
|
Environment=PAPERLESS_DBPORT=5432
|
||||||
|
Environment=PAPERLESS_DBNAME=paperless
|
||||||
|
Environment=PAPERLESS_DBUSER=paperless
|
||||||
|
Environment=PAPERLESS_DBPASS=paperless
|
||||||
|
|
||||||
|
Environment=PAPERLESS_REDIS=redis://paperless-ngx-redis:6379
|
||||||
|
|
||||||
|
PAPERLESS_CONSUMER_ENABLE_BARCODES={{ paperless_barcode_enable }}
|
||||||
|
|
||||||
|
Network=traefik.network
|
||||||
|
Network=paperless.network
|
||||||
|
|
||||||
|
Volume=/var/paperless-ngx/data:/usr/src/paperless/data:rw
|
||||||
|
Volume=/var/paperless-ngx/media:/usr/src/paperless/media:rw
|
||||||
|
Volume=/var/paperless-ngx/export:/usr/src/paperless/export:rw
|
||||||
|
Volume=/var/paperless-ngx/consume:/usr/src/paperless/consume:rw
|
||||||
|
|
||||||
|
NoNewPrivileges=true
|
||||||
|
DropCapability=All
|
||||||
|
AddCapability=net_bind_service
|
||||||
|
|
||||||
|
#UserNS=keep-id
|
||||||
|
# Required to access the Podman Socket
|
||||||
|
#SecurityLabelDisable=true
|
||||||
|
PodmanArgs=--userns=keep-id --security-opt label=disable
|
||||||
|
|
||||||
|
Label="traefik.http.routers.paperless-ngx.tls.certresolver=resolver"
|
||||||
|
Label="traefik.http.routers.paperless-ngx.tls=true"
|
||||||
|
Label="traefik.http.routers.paperless-ngx.rule=Host(`{{ paperless_ngx_url }}`)"
|
||||||
|
Label="traefik.http.routers.paperless-ngx.service=paperless-ngx"
|
||||||
|
Label="traefik.http.services.paperless-ngx.loadbalancer.server.port=8000"
|
||||||
|
|
||||||
|
HealthCmd="curl -fs -S --max-time 2 http://localhost:8000"
|
||||||
|
HealthInterval=30s
|
||||||
|
HealthTimeout=20s
|
||||||
|
HealthRetries=5
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=on-failure
|
||||||
|
# Restart Delay
|
||||||
|
RestartSec=30
|
||||||
|
# Allowed time for the service to start.
|
||||||
|
TimeoutStartSec=90
|
||||||
|
# Allowed time for the service to stop.
|
||||||
|
TimeoutStopSec=90
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
2
templates/paperless.network
Normal file
2
templates/paperless.network
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[Network]
|
||||||
|
Label=app=paperless-ngx
|
2
tests/inventory
Normal file
2
tests/inventory
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
192.168.1.142
|
||||||
|
|
5
tests/test.yml
Normal file
5
tests/test.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
remote_user: root
|
||||||
|
roles:
|
||||||
|
- role-paperless-ngx
|
2
vars/main.yml
Normal file
2
vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# vars file for role-paperless-ng
|
Loading…
Reference in New Issue
Block a user