Strip trailing whitespace and blank lines, name the getent tasks, and fix Jinja spacing.
50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
---
|
|
# Tasks for Stirling-PDF role
|
|
- name: Pull Stirling-PDF image
|
|
docker_image:
|
|
name: "{{ image }}"
|
|
source: pull
|
|
force_source: yes
|
|
|
|
- name: Ensure Stirling-PDF Directory exists
|
|
file:
|
|
path: "/var/lib/{{ host_directory }}"
|
|
state: directory
|
|
mode: 0755
|
|
|
|
- name: Ensure Directory for the tesseract ocr training data exists
|
|
file:
|
|
path: "/var/lib/{{ host_directory }}/training-data"
|
|
state: directory
|
|
mode: 0755
|
|
|
|
- name: Check if tesseract ocr training data exists
|
|
stat:
|
|
path: "/var/lib/{{ host_directory }}/training-data/eng.traineddata"
|
|
register: traineddata
|
|
|
|
- name: Download eng.traineddata
|
|
get_url:
|
|
url: "https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata"
|
|
dest: "/var/lib/{{ host_directory }}/training-data/eng.traineddata"
|
|
mode: '0644'
|
|
when: not traineddata.stat.exists
|
|
|
|
- name: Create Stirling-PDF container
|
|
docker_container:
|
|
name: "{{ container }}"
|
|
image: "{{ image }}"
|
|
state: started
|
|
restart_policy: "unless-stopped"
|
|
env:
|
|
DOCKER_ENABLE_SECURITY: "false"
|
|
INSTALL_BOOK_AND_ADVANCED_HTML_OPS: "false"
|
|
LANGS: en_GB
|
|
published_ports:
|
|
- "127.0.0.1:{{ host_port }}:8080"
|
|
volumes:
|
|
- "/var/lib/{{ host_directory }}/training-data:/usr/share/tessdata"
|
|
- "/var/lib/{{ host_directory }}/extra-configs:/configs"
|
|
- "/var/lib/{{ host_directory }}/logs:/logs"
|
|
- "/var/lib/{{ host_directory }}/custom-files:/customFiles"
|