Add readme.

Fix linting.
Remove posrgresql port by default.
This commit is contained in:
Laur Ivan 2022-10-07 14:50:14 +02:00
parent ced3dedd0e
commit a659a3c52a
3 changed files with 117 additions and 26 deletions

139
README.md
View File

@ -1,38 +1,129 @@
Role Name # laurivan.paperless
=========
A brief description of the role goes here. This role installs paperless-ngx via docker-compose.
Requirements ## Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. You need to have a machine capable of running docker and docker-compose.
Role Variables ## Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. This role uses the variables listed below, along with default values (see defaults/main.yml).
Dependencies ### Docker
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. This role allows you to select versions of the various docker images used by paperless-ngx:
Example Playbook ```yml
---------------- paperless_image_version_redis: "7"
paperless_image_version_gotenberg: "7.4"
paperless_image_version_tika: "latest"
paperless_image_version_paperless: "latest"
```
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: ### Ports
By default, only paperless UI is exposed:
- hosts: servers ```yml
roles: paperless_port: 38000
- { role: username.rolename, x: 42 } ```
License You can expose the PostgreSQL port as well for backups via:
-------
BSD ```yml
paperless_db_port: 5432
```
Author Information ### Run as
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed). You can run the docker containers as a different user via:
```yml
paperless_uid:
paperless_gid:
```
If these values are empty, the current ansible user is used :)
### Credentials
When you install paperless for the first time, you need to add a default admin user (username and password):
```yml
paperless_admin_user: "admin"
paperless_admin_password: "changeme"
```
### Directories
#### Configuration
By default, all configuration files (e.g. `docker-compose.yml`) are placed in *~/paperless*. You can change this via:
```yml
paperless_setup_path: "~/paperless"
```
#### Ingestion and export
Paplerless allows you to inport/export documents via directories:
```yml
paperless_consumer_path: "/mnt/documents-consume"
paperless_volume_consume: "{{ paperless_consumer_path }}/consume"
paperless_volume_export: "{{ paperless_consumer_path }}/export"
```
#### Docker persistence
You need to set up various volumes for data persistence. They are:
```yml
paperless_volume_base: "/mnt/documents"
paperless_volume_media: "{{ paperless_volume_base }}/media"
paperless_volume_metadata: "{{ paperless_volume_base }}/data"
paperless_volume_redis: "{{ paperless_volume_base }}/redis"
paperless_volume_db: "{{ paperless_volume_base }}/db"
```
**Notes:**
1. The `paperless_volume_base` provided for convenience as default.
2. The volumes are directory-based. If you want this role to support docker volumes, please do a pull request :)
## Database
By default, this instance is configured with PostgreSQL:
```yml
paperless_image_version_db: "13-alpine"
paperless_db_host: "postgres"
paperless_db_port:
paperless_db_user: "paperless"
paperless_db_password: "changeme"
```
If the value for `paperless_db_host` is not **postgres**, then the postgres container is not installed, and you need to provide a different DB.
## Dependencies
No dependencies.
## Example Playbook
```yml
- hosts: servers
roles:
- laurivan.paperless
```
## License
MIT
## Author Information
This role was created in 2022 by [Laur Ivan](https://www.laurivan.com)

View File

@ -28,6 +28,6 @@ paperless_port: 38000
paperless_image_version_db: "13-alpine" paperless_image_version_db: "13-alpine"
paperless_db_host: "postgres" paperless_db_host: "postgres"
paperless_db_port: 5432 paperless_db_port:
paperless_db_user: "paperless" paperless_db_user: "paperless"
paperless_db_password: "changeme" paperless_db_password: "changeme"

View File

@ -33,7 +33,7 @@
- name: Write configuration files - name: Write configuration files
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}.j2" src: "{{ item }}.j2"
dest: "{{ paperless_setup_path | expanduser }}/{{ item }}" dest: "{{ paperless_setup_path | expanduser }}/{{ item }}"
mode: '0640' mode: '0640'
loop: loop:
- "docker-compose.yml" - "docker-compose.yml"