--- - 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"