ansible-nas/roles/paperless_ng/tasks/main.yml
2022-01-29 00:54:39 +01:00

67 lines
2.4 KiB
YAML

---
- name: Create paperless_ng directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ 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 }}"
- name: Create paperless_ng network
docker_network:
name: "{{ paperless_ng_container_network_name }}"
- name: paperless_ng redis broker
docker_container:
name: "{{ paperless_ng_container_name_redis }}"
image: redis:6.0
pull: true
restart_policy: unless-stopped
memory: "{{ paperless_ng_redis_memory }}"
networks:
- name: "{{ paperless_ng_container_network_name }}"
- name: paperless_ng postgres Docker Container
docker_container:
name: "{{ paperless_ng_container_name_postgres }}"
image: postgres:13
pull: true
volumes:
- "{{ paperless_ng_postgres_directory }}:/var/lib/postgresql/data"
env:
POSTGRES_DB: "{{ paperless_ng_postgres_db }}"
POSTGRES_USER: "{{ paperless_ng_postgres_user }}"
POSTGRES_PASSWORD: "{{ paperless_ng_postgres_password }}"
restart_policy: unless-stopped
memory: "{{ paperless_ng_postgres_memory }}"
networks:
- name: "{{ paperless_ng_container_network_name }}"
- name: paperless_ng UI Docker Container
docker_container:
name: "{{ paperless_ng_container_name_uiserver }}"
image: jonaswinkler/paperless-ng:latest
pull: true
volumes:
- "{{ 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"
ports:
- "{{ paperless_ng_port }}:8000"
env:
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 }}"
restart_policy: unless-stopped
memory: "{{ paperless_ng_ui_memory }}"
networks:
- name: "{{ paperless_ng_container_network_name }}"