summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-01-06 01:30:20 +0000
committerNick White <git@njw.name>2019-01-06 01:30:20 +0000
commit28549fb8233b36a2b1c30f66736e55e48ec78f3d (patch)
tree9b058c7b2391201a296f91df0259cfaad6babf6e
parent78284f6f93de2507564bce7fc714dbb872f356ce (diff)
Add scantailor role
-rw-r--r--hosts3
-rw-r--r--roles/scantailor/tasks/main.yml2
-rw-r--r--roles/scantailor/tasks/scantailor.yml41
-rw-r--r--site.yml7
4 files changed, 53 insertions, 0 deletions
diff --git a/hosts b/hosts
index 01c1526..5393c32 100644
--- a/hosts
+++ b/hosts
@@ -6,3 +6,6 @@ devami
[ocropussies]
devami
+
+[scantailors]
+devami
diff --git a/roles/scantailor/tasks/main.yml b/roles/scantailor/tasks/main.yml
new file mode 100644
index 0000000..788df22
--- /dev/null
+++ b/roles/scantailor/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: scantailor.yml
diff --git a/roles/scantailor/tasks/scantailor.yml b/roles/scantailor/tasks/scantailor.yml
new file mode 100644
index 0000000..8a8820e
--- /dev/null
+++ b/roles/scantailor/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/site.yml b/site.yml
index 72bf824..71334eb 100644
--- a/site.yml
+++ b/site.yml
@@ -27,3 +27,10 @@
roles:
- ocropuser
+
+- name: Configure servers for Scantailor
+ hosts: scantailors
+ become: yes
+
+ roles:
+ - scantailor