From d0c5f2c02ec2fd0626c0bb6f0cc3f986178b1b7d Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 6 Jan 2019 01:03:31 +0000 Subject: Add ocropuser role to install ocropus; tested and working --- hosts | 3 +++ roles/ocropuser/tasks/main.yml | 2 ++ roles/ocropuser/tasks/ocropus.yml | 33 +++++++++++++++++++++++++++++++++ site.yml | 7 +++++++ 4 files changed, 45 insertions(+) create mode 100644 roles/ocropuser/tasks/main.yml create mode 100644 roles/ocropuser/tasks/ocropus.yml diff --git a/hosts b/hosts index b994a4b..01c1526 100644 --- a/hosts +++ b/hosts @@ -3,3 +3,6 @@ devami [tesstrainers] devami + +[ocropussies] +devami diff --git a/roles/ocropuser/tasks/main.yml b/roles/ocropuser/tasks/main.yml new file mode 100644 index 0000000..79ae937 --- /dev/null +++ b/roles/ocropuser/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: ocropus.yml diff --git a/roles/ocropuser/tasks/ocropus.yml b/roles/ocropuser/tasks/ocropus.yml new file mode 100644 index 0000000..51025e6 --- /dev/null +++ b/roles/ocropuser/tasks/ocropus.yml @@ -0,0 +1,33 @@ +--- +# Installs ocropus + +- name: Install ocropus dependencies + package: name={{ item }} state=present + with_items: + - git + - python-lxml + - python-pillow + - python2-pip + - scipy + - tkinter + +- name: Install extra dependencies with pip (as user) + pip: name={{ item }} extra_args="--user -U" + become: no + with_items: + - matplotlib + - numpy + +- name: Clone ocropus repository + git: + repo: https://github.com/tmbdev/ocropy/ + dest: /home/ec2-user/src/ocropy + depth: 1 + become: no + register: ocroclone + +- name: Install ocropus + command: python setup.py install + args: + chdir: /home/ec2-user/src/ocropy + when: ocroclone.changed diff --git a/site.yml b/site.yml index 9e0f7b9..72bf824 100644 --- a/site.yml +++ b/site.yml @@ -20,3 +20,10 @@ roles: - tesstrainer + +- name: Configure servers for Ocropus + hosts: ocropussies + become: yes + + roles: + - ocropuser -- cgit v1.2.1-24-ge1ad