ansible-nas/roles/paperless_ng/tasks/main.yml

68 lines
2.4 KiB
YAML
Raw Normal View History

2022-01-08 18:34:13 +00:00
---
- name: Create paperless_ng directories
file:
path: "{{ item }}"
state: directory
with_items:
2022-01-08 23:25:58 +00:00
- "{{ paperless_ng_config_directory }}"
- "{{ paperless_ng_files_directory }}"
- "{{ paperless_ng_postgres_directory }}"
- "{{ paperless_ng_data_directory }}"
- "{{ paperless_ng_export_directory }}"
- "{{ paperless_ng_media_directory }}"
- "{{ paperless_ng_consume_directory }}"
2022-01-08 18:34:13 +00:00
- name: Create paperless_ng network
docker_network:
2022-01-08 23:25:58 +00:00
name: "{{ paperless_ng_container_network_name }}"
2022-01-08 18:34:13 +00:00
2022-08-23 21:26:40 +00:00
- name: Create paperless_ng redis broker
2022-01-08 18:34:13 +00:00
docker_container:
2022-01-08 23:25:58 +00:00
name: "{{ paperless_ng_container_name_redis }}"
2022-01-08 18:34:13 +00:00
image: redis:6.0
pull: true
restart_policy: unless-stopped
2022-01-08 23:28:19 +00:00
memory: "{{ paperless_ng_redis_memory }}"
2022-01-08 18:34:13 +00:00
networks:
2022-01-08 23:25:58 +00:00
- name: "{{ paperless_ng_container_network_name }}"
2022-01-08 18:34:13 +00:00
2022-08-23 21:26:40 +00:00
- name: Create paperless_ng postgres Docker Container
2022-01-08 18:34:13 +00:00
docker_container:
2022-01-28 23:54:39 +00:00
name: "{{ paperless_ng_container_name_postgres }}"
2022-01-08 18:34:13 +00:00
image: postgres:13
pull: true
volumes:
2022-01-08 23:25:58 +00:00
- "{{ paperless_ng_postgres_directory }}:/var/lib/postgresql/data"
2022-01-08 18:34:13 +00:00
env:
2022-01-08 23:25:58 +00:00
POSTGRES_DB: "{{ paperless_ng_postgres_db }}"
POSTGRES_USER: "{{ paperless_ng_postgres_user }}"
POSTGRES_PASSWORD: "{{ paperless_ng_postgres_password }}"
2022-01-08 18:34:13 +00:00
restart_policy: unless-stopped
2022-01-08 23:28:19 +00:00
memory: "{{ paperless_ng_postgres_memory }}"
2022-01-08 18:34:13 +00:00
networks:
2022-01-08 23:25:58 +00:00
- name: "{{ paperless_ng_container_network_name }}"
2022-01-08 18:34:13 +00:00
2022-08-23 21:26:40 +00:00
- name: Create paperless_ng UI Docker Container
2022-01-08 18:34:13 +00:00
docker_container:
2022-01-28 23:54:39 +00:00
name: "{{ paperless_ng_container_name_uiserver }}"
2022-01-08 18:34:13 +00:00
image: jonaswinkler/paperless-ng:latest
pull: true
volumes:
2022-01-08 23:25:58 +00:00
- "{{ paperless_ng_data_directory }}:/usr/src/paperless/data"
- "{{ paperless_ng_media_directory }}:/usr/src/paperless/media"
- "{{ paperless_ng_export_directory }}:/usr/src/paperless/export"
- "{{ paperless_ng_consume_directory }}:/usr/src/paperless/consume"
2022-01-08 18:34:13 +00:00
ports:
2022-01-28 23:54:39 +00:00
- "{{ paperless_ng_port }}:8000"
2022-01-08 18:34:13 +00:00
env:
2022-01-08 23:25:58 +00:00
PAPERLESS_REDIS: "redis://{{ paperless_ng_container_name_redis | string }}:6379"
PAPERLESS_DBHOST: "{{ paperless_ng_container_name_postgres | string }}"
USERMAP_UID: "{{ paperless_ng_user_id }}"
USERMAP_GID: "{{ paperless_ng_group_id }}"
PAPERLESS_OCR_LANGUAGES: "{{ paperless_ng_languages }}"
2022-01-08 18:34:13 +00:00
restart_policy: unless-stopped
2022-01-08 23:28:19 +00:00
memory: "{{ paperless_ng_ui_memory }}"
2022-01-08 18:34:13 +00:00
networks:
2022-01-08 23:25:58 +00:00
- name: "{{ paperless_ng_container_network_name }}"