From f5385e25f40c8c9140bb9deacbfda42eaa5c8a1c Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 6 Jan 2019 09:32:12 +0000 Subject: Move scantailor under preprocessing role, and install pdfimages there --- hosts | 2 +- roles/preprocessor/tasks/main.yml | 3 +++ roles/preprocessor/tasks/pdfimages.yml | 5 ++++ roles/preprocessor/tasks/scantailor.yml | 41 +++++++++++++++++++++++++++++++++ roles/scantailor/tasks/main.yml | 2 -- roles/scantailor/tasks/scantailor.yml | 41 --------------------------------- site.yml | 6 ++--- 7 files changed, 53 insertions(+), 47 deletions(-) create mode 100644 roles/preprocessor/tasks/main.yml create mode 100644 roles/preprocessor/tasks/pdfimages.yml create mode 100644 roles/preprocessor/tasks/scantailor.yml delete mode 100644 roles/scantailor/tasks/main.yml delete mode 100644 roles/scantailor/tasks/scantailor.yml diff --git a/hosts b/hosts index 5393c32..2272d18 100644 --- a/hosts +++ b/hosts @@ -7,5 +7,5 @@ devami [ocropussies] devami -[scantailors] +[preprocessors] devami diff --git a/roles/preprocessor/tasks/main.yml b/roles/preprocessor/tasks/main.yml new file mode 100644 index 0000000..e5823e4 --- /dev/null +++ b/roles/preprocessor/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include: pdfimages.yml +- include: scantailor.yml diff --git a/roles/preprocessor/tasks/pdfimages.yml b/roles/preprocessor/tasks/pdfimages.yml new file mode 100644 index 0000000..81bd1eb --- /dev/null +++ b/roles/preprocessor/tasks/pdfimages.yml @@ -0,0 +1,5 @@ +--- +# Installs pdfimages + +- name: Install poppler-utils for pdfimages + package: name=poppler-utils state=present diff --git a/roles/preprocessor/tasks/scantailor.yml b/roles/preprocessor/tasks/scantailor.yml new file mode 100644 index 0000000..8a8820e --- /dev/null +++ b/roles/preprocessor/tasks/scantailor.yml @@ -0,0 +1,41 @@ +--- +# Installs scantailor + +- name: Install scantailor dependencies + package: name={{ item }} state=present + with_items: + - boost-devel + - cmake + - gcc-c++ + - git + - libjpeg-turbo-devel + - libpng-devel + - libtiff-devel + - libXrender-devel + - make + - qt-devel + - zlib-devel + +- name: Clone scantailor repository + git: + repo: https://github.com/scantailor/scantailor + dest: /home/ec2-user/src/scantailor + depth: 1 + become: no + register: scanclone + +- name: Configure and build scantailor + command: "{{ item }}" + args: + chdir: /home/ec2-user/src/scantailor + with_items: + - cmake . + - make + become: no + when: scanclone.changed + +- name: Install scantailor + command: make install + args: + chdir: /home/ec2-user/src/scantailor + when: scanclone.changed diff --git a/roles/scantailor/tasks/main.yml b/roles/scantailor/tasks/main.yml deleted file mode 100644 index 788df22..0000000 --- a/roles/scantailor/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: scantailor.yml diff --git a/roles/scantailor/tasks/scantailor.yml b/roles/scantailor/tasks/scantailor.yml deleted file mode 100644 index 8a8820e..0000000 --- a/roles/scantailor/tasks/scantailor.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -# Installs scantailor - -- name: Install scantailor dependencies - package: name={{ item }} state=present - with_items: - - boost-devel - - cmake - - gcc-c++ - - git - - libjpeg-turbo-devel - - libpng-devel - - libtiff-devel - - libXrender-devel - - make - - qt-devel - - zlib-devel - -- name: Clone scantailor repository - git: - repo: https://github.com/scantailor/scantailor - dest: /home/ec2-user/src/scantailor - depth: 1 - become: no - register: scanclone - -- name: Configure and build scantailor - command: "{{ item }}" - args: - chdir: /home/ec2-user/src/scantailor - with_items: - - cmake . - - make - become: no - when: scanclone.changed - -- name: Install scantailor - command: make install - args: - chdir: /home/ec2-user/src/scantailor - when: scanclone.changed diff --git a/site.yml b/site.yml index 71334eb..85a6cd2 100644 --- a/site.yml +++ b/site.yml @@ -28,9 +28,9 @@ roles: - ocropuser -- name: Configure servers for Scantailor - hosts: scantailors +- name: Configure servers for preprocessing + hosts: preprocessors become: yes roles: - - scantailor + - preprocessor -- cgit v1.2.1-24-ge1ad