role-paperless-ngx/tasks/main.yml

114 lines
2.8 KiB
YAML
Raw Permalink Normal View History

2023-09-20 19:47:16 +00:00
---
- name: Create podman folder
file:
path: /etc/containers/systemd
state: directory
mode: 0775
recurse: yes
- name: Create paperless data folder
file:
path: "/var/paperless-ngx/data"
state: directory
mode: 0775
recurse: yes
- name: Create paperless media folder
file:
path: "/var/paperless-ngx/media"
state: directory
mode: 0775
recurse: yes
- name: Create paperless export folder
file:
path: "/var/paperless-ngx/export"
state: directory
mode: 0775
recurse: yes
- name: Create paperless consume folder
file:
path: "/var/paperless-ngx/consume"
state: directory
mode: 0775
recurse: yes
- name: Create paperless redis folder
file:
path: "/var/paperless-ngx/redis"
state: directory
mode: 0775
recurse: yes
- name: Create paperless postgres folder
file:
path: "/var/paperless-ngx/postgres"
state: directory
mode: 0775
recurse: yes
- name: Setup Podman quadlet
block:
2023-09-20 19:53:32 +00:00
- name: Copy paperless.network
2023-09-20 19:47:16 +00:00
ansible.builtin.template:
2023-09-20 19:53:32 +00:00
src: paperless.network
dest: "/etc/containers/systemd/paperless.network"
- name: Copy paperless-ngx.container
ansible.builtin.template:
src: paperless-ngx.quadlet.j2
dest: "/etc/containers/systemd/paperless-ngx.container"
- name: Copy paperless-ngx-gotenberg.container
ansible.builtin.template:
src: paperless-ngx-gotenberg.quadlet.j2
dest: "/etc/containers/systemd/paperless-ngx-gotenberg.container"
- name: Copy paperless-ngx-postgres.container
ansible.builtin.template:
src: paperless-ngx-postgres.quadlet.j2
dest: "/etc/containers/systemd/paperless-ngx-postgres.container"
- name: Copy paperless-ngx-redis.container
ansible.builtin.template:
src: paperless-ngx-redis.quadlet.j2
dest: "/etc/containers/systemd/paperless-ngx-redis.container"
- name: Copy paperless-ngx-tika.container
ansible.builtin.template:
src: paperless-ngx-tika.quadlet.j2
dest: "/etc/containers/systemd/paperless-ngx-tika.container"
2023-09-20 19:47:16 +00:00
- name: "Reload systemd"
ansible.builtin.systemd:
daemon_reload: true
when: ansible_service_mgr == "systemd"
2023-09-20 20:52:24 +00:00
- name: Start Paperless-ngs Redis
2023-09-20 19:47:16 +00:00
systemd_service:
enabled: true
2023-09-20 20:52:24 +00:00
name: paperless-ngx-redis
state: started
- name: Start Paperless-ngs Tika
systemd_service:
enabled: true
name: paperless-ngx-tika
state: started
- name: Start Paperless-ngs Gotenberg
systemd_service:
enabled: true
name: paperless-ngx-gotenberg
state: started
- name: Start Paperless-ngs Postgres
systemd_service:
enabled: true
name: paperless-ngx-postgres
2023-09-20 19:47:16 +00:00
state: started
notify:
2023-09-20 19:53:32 +00:00
- Restart Paperless
2023-09-20 19:47:16 +00:00