Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

centos fixes #3

Merged
merged 5 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ An Ansible role that installs [Crayfish](https://github.com/Islandora-CLAW/Crayf
Available variables are listed below, along with default values:

```
# User to install crayfish with (usually the webserver user)
crayfish_user: www-data
crayfish_group: www-data
# Crayfish version to install
crayfish_version_tag: 0.0.7
# Crayfish services to install
Expand All @@ -30,7 +27,15 @@ crayfish_log_dir: /var/log/islandora
# Apache configuration directory
crayfish_apache_conf_dir: /etc/apache2
```
Some OS dependent variables are set in vars/* but can be overridden if desired:

```
# crayfish_user: www-data
# httpd_conf_directory: /etc/apache2
# crayfish_packages:
# - ImageMagick
```
=======
`crayfish_db` can be set to:
- pgsql
- mysql
Expand All @@ -41,6 +46,10 @@ There are lots more configuration settings in [defaults/main.yml](defaults/main.

## Dependencies

* Apache webserver
* PHP 7

=======
The module depends on the following. Links are provided to roles known to work with the mdoule, but should be able to work with any role providing the required software:
* [Apache](https://galaxy.ansible.com/geerlingguy/apache/)
* [PHP](https://galaxy.ansible.com/geerlingguy/php/)
Expand Down
8 changes: 6 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
crayfish_user: www-data
crayfish_version_tag: 0.0.8

crayfish_services:
- Gemini
- Houdini
- Milliner
- Hypercube

crayfish_install_dir: /var/www/html/Crayfish

crayfish_syn_token: islandora
Expand Down Expand Up @@ -90,3 +89,8 @@ crayfish_milliner_db_options:
user: "{{ crayfish_db_user }}"
password: "{{ crayfish_db_password }}"

# OS Dependent variables set in vars can be overridden here
# crayfish_user: www-data
# httpd_conf_directory: /etc/apache2
# crayfish_packages:
# - ImageMagick
37 changes: 24 additions & 13 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---

- name: Install requisite package repositories
- name: Add ImageMagick repo (apt)
apt_repository:
repo: 'ppa:lyrasis/imagemagick-jp2'
when: ansible_os_family == "Debian"

- name: Install requisite packages
apt:
name: "{{item}}"
package:
name: "{{ item }}"
state: present
with_items:
- tesseract-ocr
- imagemagick
with_items: "{{ crayfish_packages }}"

- name: Install crayfish code
git:
Expand All @@ -31,7 +30,7 @@
with_items: "{{ crayfish_services }}"

- name: Get SSL keys
include_role:
include_role:
name: Islandora-Devops.keymaster
vars:
ssl_key_public_output_path: "{{ crayfish_install_dir }}/public.key"
Expand All @@ -46,22 +45,34 @@
file:
path: /var/log/islandora
state: directory
owner: www-data
group: www-data
mode: "u+rwx,g+r,o-rwx"
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
mode: "urwx,gr,o-rwx"

- name: Create httpd config directories
file:
path: "{{httpd_conf_directory}}/{{ item }}/"
state: directory
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
mode: "urwx,gr,o-rwx"
with_items:
- "conf-available"
- "conf-enabled"
when: ansible_os_family == "RedHat"

- name: Install crayfish httpd config file
template:
src: "httpd/{{item}}.conf.j2"
dest: "/etc/apache2/conf-available/{{item}}.conf"
dest: "{{httpd_conf_directory}}/conf-available/{{item}}.conf"
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
with_items: "{{ crayfish_services }}"

- name: Symlink crayfish httpd config file into action
file:
src: "/etc/apache2/conf-available/{{item}}.conf"
dest: "/etc/apache2/conf-enabled/{{item}}.conf"
src: "{{httpd_conf_directory}}/conf-available/{{item}}.conf"
dest: "{{httpd_conf_directory}}/conf-enabled/{{item}}.conf"
owner: "{{ crayfish_user }}"
group: "{{ crayfish_user }}"
state: link
Expand Down
18 changes: 18 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
---

- name: Include OS-specific variables
include_vars: "{{ ansible_os_family}}.yml"

- name: Define crayfish_user
set_fact:
crayfish_user: "{{ __crayfish_user }}"
when: crayfish_user is not defined

- name: Define httpd_conf_directory
set_fact:
httpd_conf_directory: "{{ __httpd_conf_directory }}"
when: httpd_conf_directory is not defined

- name: Define OS-specific crayfish_packages to install
set_fact:
crayfish_packages: "{{ __crayfish_packages }}"
when: crayfish_packages is not defined

- include: db-mysql.yml
tags:
- crayfish
Expand Down
6 changes: 6 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

__crayfish_user: www-data
__httpd_conf_directory: /etc/apache2
__crayfish_packages:
- imagemagick
6 changes: 6 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

__crayfish_user: apache
__httpd_conf_directory: /etc/httpd
__crayfish_packages:
- ImageMagick