ansible-role-paperless-ngx/tasks/main.yml

50 lines
1.3 KiB
YAML
Raw Normal View History

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"
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
become: false