From 80b29c4f8024a323fd1cd718fe7313c0e4d305e5 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sat, 5 Jan 2019 02:05:00 +0000 Subject: Add tesstrainer group, and rename devami host --- host_vars/devami | 6 ++++ host_vars/devami1 | 6 ---- hosts | 7 ++-- roles/tesstrainer/tasks/main.yml | 2 ++ roles/tesstrainer/tasks/tesstraining.yml | 56 ++++++++++++++++++++++++++++++++ site.yml | 7 ++++ 6 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 host_vars/devami delete mode 100644 host_vars/devami1 create mode 100644 roles/tesstrainer/tasks/main.yml create mode 100644 roles/tesstrainer/tasks/tesstraining.yml diff --git a/host_vars/devami b/host_vars/devami new file mode 100644 index 0000000..430bc65 --- /dev/null +++ b/host_vars/devami @@ -0,0 +1,6 @@ +--- +ansible_host: ec2-3-8-40-197.eu-west-2.compute.amazonaws.com +ansible_user: ec2-user +ansible_ssh_private_key_file: ~/rescribe/2018-naturalphilosophy/aws/awsdev2.pem +# note: may need to set control_path in ~/.ansible.cfg as described at +# https://stackoverflow.com/questions/35970686/ansible-ssh-error-unix-listener-too-long-for-unix-domain-socket diff --git a/host_vars/devami1 b/host_vars/devami1 deleted file mode 100644 index 430bc65..0000000 --- a/host_vars/devami1 +++ /dev/null @@ -1,6 +0,0 @@ ---- -ansible_host: ec2-3-8-40-197.eu-west-2.compute.amazonaws.com -ansible_user: ec2-user -ansible_ssh_private_key_file: ~/rescribe/2018-naturalphilosophy/aws/awsdev2.pem -# note: may need to set control_path in ~/.ansible.cfg as described at -# https://stackoverflow.com/questions/35970686/ansible-ssh-error-unix-listener-too-long-for-unix-domain-socket 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 -- cgit v1.2.1-24-ge1ad