2022-10-07 14:31:40 +02:00
|
|
|
---
|
|
|
|
# tasks file for paperless
|
|
|
|
- name: Set up main directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ item }}"
|
|
|
|
owner: "{{ ansible_effective_user_id }}"
|
|
|
|
group: "{{ ansible_effective_group_id }}"
|
|
|
|
mode: "0750"
|
|
|
|
with_items:
|
|
|
|
- "{{ paperless_setup_path | expanduser }}"
|
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Set up data directories
|
|
|
|
ansible.builtin.file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ item }}"
|
|
|
|
owner: "{% if paperless_uid %}{{ paperless_uid }}{% else %}{{ ansible_effective_user_id }}{% endif %}"
|
|
|
|
group: "{% if paperless_gid %}{{ paperless_gid }}{% else %}{{ ansible_effective_group_id }}{% endif %}"
|
|
|
|
mode: "0750"
|
|
|
|
with_items:
|
|
|
|
- "{{ paperless_volume_db }}"
|
|
|
|
- "{{ paperless_volume_media }}"
|
|
|
|
- "{{ paperless_volume_metadata }}"
|
|
|
|
- "{{ paperless_volume_consume }}"
|
|
|
|
- "{{ paperless_volume_export }}"
|
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Write configuration files
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: "{{ item }}.j2"
|
2022-10-07 14:50:14 +02:00
|
|
|
dest: "{{ paperless_setup_path | expanduser }}/{{ item }}"
|
2022-10-07 14:31:40 +02:00
|
|
|
mode: '0640'
|
|
|
|
loop:
|
|
|
|
- "docker-compose.yml"
|
|
|
|
- "env.paperless.conf"
|
|
|
|
- "env.db.conf"
|
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
|
|
|
|
- name: Ensure all requested components are running.
|
|
|
|
community.docker.docker_compose:
|
|
|
|
project_src: "{{ paperless_setup_path | expanduser }}"
|
|
|
|
build: false
|
2023-02-14 01:28:39 +01:00
|
|
|
pull: "{{ paperless_pull_images }}"
|
2022-10-07 14:31:40 +02:00
|
|
|
become: false
|