Added: paperless-ngx
This commit is contained in:
1 parent
230a360ad7
commit
376255e15d
8 files changed
+167
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# Handlers for Nginx role
|
||||
- name: Reload Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# Tasks for Nginx role
|
||||
- name: Check if Nginx conf file exists
|
||||
stat:
|
||||
path: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
register: status
|
||||
|
||||
- name: No need to reload Nginx
|
||||
debug:
|
||||
msg: "No need to reload Nginx as sites-available entries have already been created"
|
||||
|
||||
- name: Set Nginx conf file
|
||||
when: status.stat.exists == false
|
||||
template:
|
||||
src: "files/nginx.conf.j2"
|
||||
dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
|
||||
- name: Enable new site
|
||||
when: status.stat.exists == false
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
||||
state: link
|
||||
notify: Reload Nginx
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
- name: Pull image
|
||||
docker_image:
|
||||
name: "{{ image_name }}"
|
||||
source: pull
|
||||
force_source: yes
|
||||
|
||||
|
||||
- name: Ensure Paperless Directories exists
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
loop:
|
||||
- "/var/lib/{{ host_directory }}"
|
||||
- "/var/lib/{{ host_directory }}/data"
|
||||
- "/var/lib/{{ host_directory }}/media"
|
||||
- "/var/lib/{{ host_directory }}/export"
|
||||
- "/var/lib/{{ host_directory }}/consume"
|
||||
|
||||
- name: Run Paperless-NGX Docker container
|
||||
community.docker.docker_container:
|
||||
name: "{{ container_name }}"
|
||||
image: "{{ image_name }}:{{ image_version }}"
|
||||
state: started
|
||||
restart_policy: always
|
||||
links:
|
||||
- postgres:db
|
||||
- redis:redis
|
||||
env:
|
||||
PAPERLESS_URL: "https://{{ http_host }}"
|
||||
PAPERLESS_REDIS: redis://redis:6379
|
||||
PAPERLESS_DBHOST: db
|
||||
PAPERLESS_DBUSER: "{{ postgres_user }}"
|
||||
PAPERLESS_DBPASS: "{{ postgres_password }}"
|
||||
PAPERLESS_DBNAME: "{{ postgres_db }}"
|
||||
PAPERLESS_TIME_ZONE: "{{ paperless_time_zone }}"
|
||||
PAPERLESS_OCR_USER_ARGS: '{"invalidate_digital_signatures": true}'
|
||||
volumes:
|
||||
- "/var/lib/{{ host_directory }}/data:/usr/src/paperless/data"
|
||||
- "/var/lib/{{ host_directory }}/media:/usr/src/paperless/media"
|
||||
- "/var/lib/{{ host_directory }}/export:/usr/src/paperless/export"
|
||||
- "/var/lib/{{ host_directory }}/consume:/usr/src/paperless/consume"
|
||||
ports:
|
||||
- "127.0.0.1:{{ web_port }}:8000"
|
||||
Reference in new issue
Block a user