ansible-nas/roles/paperless_ng/tasks/main.yml
2022-01-08 19:34:13 +01:00

62 lines
2.1 KiB
YAML

---
- name: Create paperless_ng directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ paperless_data_directory }}"
- "{{ paperless_data_directory }}/postgres"
- "{{ paperless_data_directory }}/data"
- "{{ paperless_data_directory }}/media"
- "{{ paperless_data_directory }}/export"
- name: Create paperless_ng network
docker_network:
name: "{{ paperless_container_network_name }}"
- name: paperless_ng redis broker
docker_container:
name: "{{ paperless_container_name_redis }}"
image: redis:6.0
pull: true
restart_policy: unless-stopped
networks:
- name: "{{ paperless_container_network_name }}"
- name: paperless_ng postgres Docker Container
docker_container:
name: "{{ paperless_container_name_postgres }}"
image: postgres:13
pull: true
volumes:
- "{{ paperless_data_directory }}/postgres:/var/lib/postgresql/data"
env:
POSTGRES_DB: "{{ paperless_postgres_db }}"
POSTGRES_USER: "{{ paperless_postgres_user }}"
POSTGRES_PASSWORD: "{{ paperless_postgres_password }}"
restart_policy: unless-stopped
memory: "{{ nextcloud_mysql_memory }}"
networks:
- name: "{{ paperless_container_network_name }}"
- name: paperless_ng UI Docker Container
docker_container:
name: "{{ paperless_container_name_uiserver }}"
image: jonaswinkler/paperless-ng:latest
pull: true
volumes:
- "{{ paperless_data_directory }}/data:/usr/src/paperless/data"
- "{{ paperless_data_directory }}/media:/usr/src/paperless/media"
- "{{ paperless_data_directory }}/export:/usr/src/paperless/export"
- "{{ paperless_consume_directory }}:/usr/src/paperless/consume"
ports:
- "{{ paperless_port }}:8000"
env:
PAPERLESS_REDIS: "redis://{{ paperless_container_name_redis | string }}:6379"
PAPERLESS_DBHOST: "{{ paperless_container_name_postgres | string }}"
USERMAP_UID: "{{ paperless_user_id }}"
USERMAP_GID: "{{ paperless_group_id }}"
PAPERLESS_OCR_LANGUAGES: "{{ paperless_languages }}"
restart_policy: unless-stopped
networks:
- name: "{{ paperless_container_network_name }}"