Update to 2021-09-06 18:00

master
Daniel Berteaud 3 years ago
parent 224cc4c0d4
commit 7e1bf86baa
  1. 12
      roles/paperless_ng/defaults/main.yml
  2. 6
      roles/paperless_ng/handlers/main.yml
  3. 1
      roles/paperless_ng/meta/main.yml
  4. 4
      roles/paperless_ng/tasks/conf.yml
  5. 6
      roles/paperless_ng/tasks/install.yml
  6. 6
      roles/paperless_ng/tasks/services.yml

@ -2,6 +2,8 @@
# The version to deploy
paperless_version: 1.5.0
# Instance ID, as you can deploy several instances on the same server
paperless_id: 1
# URL of the paperless archive
paperless_archive_url: https://github.com/jonaswinkler/paperless-ng/releases/download/ng-{{ paperless_version }}/paperless-ng-{{ paperless_version }}.tar.xz
# Expected checksum
@ -9,12 +11,12 @@ paperless_archive_sha1: edbbbfde6718ee7586acf1212d32ca379058cb15
# Should ansible handle install and upgrades, or only initial install
paperless_manage_upgrade: True
# Root directory where paperless will be installed
paperless_root_dir: /opt/paperless
paperless_root_dir: /opt/paperless_{{ paperless_id }}
# Paperless will monitor this dir and import files from here
paperless_consume_dir: "{{ paperless_root_dir }}/consume"
# The user under which paperless will run
paperless_user: paperless
paperless_user: paperless_{{ paperless_id }}
# Port used by paperless web interface
# You should put it behind a reverse proxy
@ -25,13 +27,13 @@ paperless_src_ip: []
# PostgreSQL database settings
paperless_db_server: "{{ pg_server | default('localhost') }}"
paperless_db_port: 5432
paperless_db_name: paperless
paperless_db_user: paperless
paperless_db_name: paperless_{{ paperless_id }}
paperless_db_user: paperless_{{ paperless_id }}
# If the password is not defined, a random one will be generated and stored in {{ papermerge_root_dir }}/meta/ansible_dbpass
# paperless_db_pass: S3cr3t.
# Redis URL
paperless_redis_url: redis://localhost:6379
paperless_redis_url: redis://localhost:6379/0
# Secret key to create session token. If not defined, a random one will be generated and stored in {{ papermerge_root_dir }}/meta/ansible_secret_key
# paperless_secret_key: SecretKey

@ -3,7 +3,7 @@
- name: restart paperless
service: name={{ item }} state=restarted
loop:
- paperless-webserver
- paperless-scheduler
- paperless-consumer
- paperless_{{ paperless_id }}-webserver
- paperless_{{ paperless_id }}-scheduler
- paperless_{{ paperless_id }}-consumer

@ -1,5 +1,6 @@
---
allow_duplicates: True
dependencies:
- role: mkdir
- role: postgresql_server

@ -16,6 +16,7 @@
app_path: "{{ paperless_root_dir }}/app/src"
virtualenv: "{{ paperless_root_dir }}/venv"
notify: restart paperless
become_user: "{{ paperless_user }}"
- name: Collect static files
django_manage:
@ -37,6 +38,7 @@
virtualenv: "{{ paperless_root_dir }}/venv"
environment:
DJANGO_SUPERUSER_PASSWORD: '{{ paperless_admin_pass }}'
failed_when: False
become_user: "{{ paperless_user }}"
tags: ged

@ -69,12 +69,12 @@
#!/bin/bash
cd {{ paperless_root_dir }}/app/src
{{ paperless_root_dir }}/venv/bin/python ./manage.py $@
dest: /usr/local/bin/paperless
dest: /usr/local/bin/paperless_{{ paperless_id }}
mode: 0755
tags: ged
- name: Install systemd units
template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item }}.service
template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item | regex_replace('^paperless','paperless_' ~ paperless_id) }}.service
loop:
- paperless-webserver
- paperless-scheduler
@ -89,7 +89,7 @@
tags: ged
- name: Install backup hooks
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/paperless mode=700
template: src={{ item }}-backup.j2 dest=/etc/backup/{{ item }}.d/paperless_{{ paperless_id }} mode=700
loop:
- pre
- post

@ -3,7 +3,7 @@
- name: Start and enable services
service: name={{ item }} state=started enabled=True
loop:
- paperless-webserver
- paperless-scheduler
- paperless-consumer
- paperless_{{ paperless_id }}-webserver
- paperless_{{ paperless_id }}-scheduler
- paperless_{{ paperless_id }}-consumer
tags: ged

Loading…
Cancel
Save