summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--host_vars/devami (renamed from host_vars/devami1)0
-rw-r--r--hosts7
-rw-r--r--roles/tesstrainer/tasks/main.yml2
-rw-r--r--roles/tesstrainer/tasks/tesstraining.yml56
-rw-r--r--site.yml7
5 files changed, 70 insertions, 2 deletions
diff --git a/host_vars/devami1 b/host_vars/devami
index 430bc65..430bc65 100644
--- a/host_vars/devami1
+++ b/host_vars/devami
diff --git a/hosts b/hosts
index 8403e20..b32a2bc 100644
--- a/hosts
+++ b/hosts
@@ -1,5 +1,8 @@
[servers]
-devami1
+devami
[tesseractors]
-devami1
+devami
+
+[tesstrainers]
+devami
diff --git a/roles/tesstrainer/tasks/main.yml b/roles/tesstrainer/tasks/main.yml
new file mode 100644
index 0000000..be4289f
--- /dev/null
+++ b/roles/tesstrainer/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: tesstraining.yml
diff --git a/roles/tesstrainer/tasks/tesstraining.yml b/roles/tesstrainer/tasks/tesstraining.yml
new file mode 100644
index 0000000..d00003f
--- /dev/null
+++ b/roles/tesstrainer/tasks/tesstraining.yml
@@ -0,0 +1,56 @@
+---
+# Installs tesseract
+
+- name: Install tesseract dependencies
+ package: name={{ item }} state=present
+ with_items:
+ - gcc-c++
+ - make
+ - libpng12-devel
+ - libjpeg-turbo-devel
+ - libtiff-devel
+ - zlib-devel
+
+- name: Install tesseract training dependencies
+ package: name={{ item }} state=present
+ with_items:
+ - libicu-devel
+ - pango-devel
+ - cairo-devel
+
+- name: Install extra tesseract development dependencies
+ package: name={{ item }} state=present
+ with_items:
+ - git
+
+- name: Clone leptonica repository
+ git:
+ repo: https://github.com/nickjwhite/leptonica
+ dest: /home/ec2-user/src/leptonica
+ version: addinstall
+ depth: 1
+
+- name: Configure leptonica environ.h
+ lineinfile:
+ dest: /home/ec2-user/src/leptonica/src/environ.h
+ line: "{{ item }}"
+ insertbefore: "^#endif * LEPTONICA_ENVIRON_H"
+ with_items:
+ - "#define HAVE_FMEMOPEN 1"
+ - "#define HAVE_FSTATAT 1"
+
+- name: Build leptonica
+ make:
+ chdir: /home/ec2-user/src/leptonica/src
+ target: "-f makefile.static install"
+ params: SHARED=yes
+
+- name: Clone tesseract repository
+ git:
+ repo: https://github.com/nickjwhite/tesseract
+ dest: /home/ec2-user/src/tesseract
+ version: simplemakev4
+ depth: 1
+
+- name: Build and install tesseract training tools
+ make: chdir=/home/ec2-user/src/tesseract target=install-training
diff --git a/site.yml b/site.yml
index 45289f3..1bdc22d 100644
--- a/site.yml
+++ b/site.yml
@@ -13,3 +13,10 @@
roles:
- tesseractor
+
+- name: Configure servers for Tesseract Training
+ hosts: tesstrainers
+ become: yes
+
+ roles:
+ - tesstrainer