Rework Paperless-ngx around Caddy, network, and storage roles

This commit is contained in:
tanshu committed 2026-10-18 21:35:55 +05:30
1 parent c2ecde0341
commit 83c2ca2187
14 files changed
+216 -83

No files matched your search

@@ -0,0 +1,59 @@
---
# rclone FUSE mounts so consume/export (Nextcloud WebDAV) and media (S3)
# take no space on the VPS beyond a small cache.
- name: Install rclone and fuse
apt:
name:
- rclone
- fuse3
state: present
update_cache: true
- name: Obscure the Nextcloud password for rclone
command: rclone obscure "{{ nextcloud_app_password }}"
register: obscured_pass
changed_when: false
no_log: true
- name: Write rclone config
template:
src: rclone.conf.j2
dest: /etc/rclone-paperless.conf
owner: root
group: root
mode: "0600"
no_log: true
notify: Restart rclone mounts
- name: Ensure mount points and cache exist
file:
path: "{{ item }}"
state: directory
mode: "0755"
loop:
- /mnt/paperless
- "{{ rclone_cache_dir }}"
- /mnt/paperless/consume
- /mnt/paperless/export
- /mnt/paperless/media
- name: Ensure the Nextcloud folders exist
command: rclone --config /etc/rclone-paperless.conf mkdir "{{ item.remote }}"
loop: "{{ rclone_mounts }}"
changed_when: false
- name: Install mount units
template:
src: rclone-mount.service.j2
dest: "/etc/systemd/system/paperless-{{ item.name }}.service"
mode: "0644"
loop: "{{ rclone_mounts }}"
notify: Restart rclone mounts
- name: Enable and start mount units
systemd:
name: "paperless-{{ item.name }}.service"
enabled: true
state: started
daemon_reload: true
loop: "{{ rclone_mounts }}"