paperless-formula/paperless/init.sls

121 lines
3.8 KiB
Text
Raw Normal View History

2024-08-28 09:49:43 +02:00
broker-data-directory-exists:
file.directory:
- name: /opt/paperless/broker
- makedirs: True
paperless-data-directory-exists:
file.directory:
- name: /opt/paperless/webserver
- makedirs: True
2024-10-04 22:02:38 +02:00
python3-pip:
pkg.installed
# https://github.com/saltstack/salt/issues/61004
python-pip-uptodate:
pip.installed:
- require:
- pkg: python3-pip
- pkgs:
- pip
- upgrade: True
# https://bugs.launchpad.net/ubuntu/+source/python-docker/+bug/2066926
# https://packages.debian.org/source/sid/python-docker
# does not work
# python-docker-package:
# pkg.installed:
# - name: python3-docker
# https://stackoverflow.com/a/78224409
# https://github.com/docker/docker-py/issues/3113
# https://github.com/saltstack/salt/issues/62689
docker-requirements:
pip.installed:
- require:
- pkg: python3-pip
- pkgs:
2024-10-25 19:58:00 +02:00
- pyyaml==5.3.1
2024-10-04 22:02:38 +02:00
# - docker==6.1.3
# - docker==7.0.0
- docker==7.1.0
# - docker==5.0.3
# - docker-py==1.10.5
# - requests<2.29.0
# - urllib3<2.0
2024-10-25 19:48:03 +02:00
- docker-compose>=1.5.0
2024-10-04 22:02:38 +02:00
# other errors that were encountered
# keyerror http+docker
# https://github.com/geerlingguy/ansible-role-docker/issues/462
# https://github.com/docker/docker-py/issues/3279
# unexpected keyword argument 'chunked'
# https://github.com/saltstack/salt/issues/65526
# 'docker.version' is not available
# https://github.com/saltstack/salt/issues/53836
# https://github.com/saltstack/salt/issues/54449
# https://github.com/saltstack/salt/issues/62602
# network is always recreated
# https://github.com/saltstack/salt/issues/66408
# otherwise it complains about scope attribute, similar to
# https://github.com/saltstack/salt/issues/50194
# https://github.com/saltstack/salt/issues/51009
# but it should be possible according to docs
# https://docs.saltproject.io/en/latest/ref/states/all/salt.states.docker_network.html#salt.states.docker_network.present
2024-09-20 17:35:44 +02:00
docker-network-paperless-exists:
docker_network.present:
- name: paperless-network
2024-10-04 22:02:38 +02:00
# - scope: local
2024-09-20 17:35:44 +02:00
2024-08-28 09:49:43 +02:00
broker-docker-container-running:
docker_container.running:
- name: broker
- image: {{ salt['pillar.get']('paperless:broker:image:path', 'docker.io/library/redis') }}:{{ salt['pillar.get']('paperless:broker:image:version', '7') }}
- container_name: broker
- restart: unless-stopped
- binds: /opt/paperless/broker:/data
- networks:
2024-09-20 17:35:44 +02:00
- paperless-network
2024-08-28 09:49:43 +02:00
gotenberg-docker-container-running:
2024-09-20 17:35:44 +02:00
docker_container.running:
2024-08-28 09:49:43 +02:00
- name: gotenberg
- image: {{ salt['pillar.get']('paperless:gotenberg:image:path', 'docker.io/gotenberg/gotenberg') }}:{{ salt['pillar.get']('paperless:gotenberg:image:version', '8.9.1') }}
- container_name: gotenberg
- restart: unless-stopped
# The gotenberg chromium route is used to convert .eml files. We do not
# want to allow external content like tracking pixels or even javascript.
- command:
- "gotenberg"
- "--chromium-disable-javascript=true"
- "--chromium-allow-list=file:///tmp/.*"
- networks:
2024-09-20 17:35:44 +02:00
- paperless-network
2024-08-28 09:49:43 +02:00
tika-docker-container-running:
2024-09-20 17:35:44 +02:00
docker_container.running:
2024-08-28 09:49:43 +02:00
- name: tika
- image: {{ salt['pillar.get']('paperless:tika:image:path', 'docker.io/apache/tika') }}:{{ salt['pillar.get']('paperless:tika:image:version', '2.9.2.1') }}
- container_name: tika
- restart: unless-stopped
- networks:
2024-09-20 17:35:44 +02:00
- paperless-network
2024-08-28 09:49:43 +02:00
2024-10-25 19:48:03 +02:00
paperless-docker-compose-env-file-present:
file.managed:
2024-10-27 16:49:20 +01:00
- name: /opt/paperless/docker-compose.env
2024-10-25 19:48:03 +02:00
- template: jinja
2024-10-27 16:35:17 +01:00
- source: salt://paperless/docker-compose.env.jinja
2024-08-28 09:49:43 +02:00
2024-10-25 19:48:03 +02:00
paperless-docker-compose-file-present:
file.managed:
2024-10-27 16:49:20 +01:00
- name: /opt/paperless/docker-compose.yml
2024-10-25 19:48:03 +02:00
- template: jinja
2024-10-27 16:49:20 +01:00
- source: salt://paperless/docker-compose.yml.jinja
2024-10-02 13:02:56 +02:00
2024-10-25 19:48:03 +02:00
paperless-docker-compose-up:
module.run:
- dockercompose.up:
2024-10-27 16:49:20 +01:00
- path: /opt/paperless/docker-compose.yml