-
Notifications
You must be signed in to change notification settings - Fork 0
/
tess.yaml
64 lines (54 loc) · 1.66 KB
/
tess.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- name: Tesseract OCR setup
hosts: localhost
remote_user: root
vars:
subsys_path: /var/imaging/subsys/Templates
tasks:
- name: Check for application's OCR subsystem
ansible.builtin.stat:
path: "{{ subsys_path }}"
register: subsys
- name: Stop playbook if OCR subsystem is missing
ansible.builtin.fail:
msg: OCR subsystem directory ({{ subsys_path }}) not found!
when: not subsys.stat.exists
- name: Check for OCR enable flag
ansible.builtin.stat:
path: "{{ subsys_path }}/.enabled"
register: enabled
- name: Enable OCR subsystem
ansible.builtin.file:
path: enabled.stat.path
state: touch
owner: listener
group: imaging
mode: "0644"
when: not enabled.stat.exists
- name: Configure application path to tesseract
ansible.builtin.replace:
path: /var/imaging/resources/configs/utilities.json
regexp: /usr/local/bin/tesseract
replace: /usr/bin/tesseract
- name: Install EPEL repository
ansible.builtin.yum:
name: epel-release
state: present
- name: Install Tesseract OCR
ansible.builtin.yum:
name: tesseract
state: present
- name: Install cpan modules for OCR
community.general.cpanm:
name: "{{ item }}"
notest: true
loop:
- IO::Interactive
- URI::Encode
- name: Add cronjob to auto-commit unclassified groups
ansible.builtin.cron:
name: Auto-commit scale tickets
special_time: hourly
user: listener
job: >
/usr/bin/perl /var/imaging/bin/img-group-autocommit.pl