Browse Source

start koha roles

lesion 2 years ago
parent
commit
6c4c271b7a
4 changed files with 148 additions and 0 deletions
  1. 8 0
      koha.yml
  2. 84 0
      roles/koha/tasks/main.yml
  3. 52 0
      roles/koha/templates/koha-sites.conf.j2
  4. 4 0
      vars/koha.yml

+ 8 - 0
koha.yml

@@ -0,0 +1,8 @@
+---
+## KOHA
+- name: Koha
+  hosts: localhost
+  roles: ['stable/common', 'koha']
+  vars_files: vars/koha.yml
+  tags: koha
+

+ 84 - 0
roles/koha/tasks/main.yml

@@ -0,0 +1,84 @@
+---
+## Based on 
+## https://wiki.koha-community.org/wiki/Debian
+
+- name: Add an Apt signing key, will not download if present
+  become: yes
+  apt_key:
+    url: https://debian.koha-community.org/koha/gpg.asc
+    state: present
+    keyring: /usr/share/keyrings/koha-community-archive-keyring.gpg 
+
+- name: Add Koha package repository
+  become: yes
+  apt_repository:
+    filename: koha.list
+    repo: "deb [signed-by=/usr/share/keyrings/koha-community-archive-keyring.gpg] http://debian.koha-community.org/koha stable main"
+    update_cache: yes 
+
+- name: Install koha and mariadb
+  become: yes
+  apt:
+    pkg:
+      - koha-common
+      - mariadb-server
+
+- name: Configure the defaults
+  become: yes
+  template:
+    src: koha-sites.conf.j2
+    dest: /etc/koha/koha-sites.conf
+
+- name: Enable the Apache2 module rewrite
+  become: yes
+  apache2_module:
+    state: present
+    name: rewrite
+
+- name: Enable the Apache2 module cgi
+  become: yes
+  apache2_module:
+    state: present
+    name: cgi
+
+- name: Make sure apache2 is restarted
+  become: yes
+  systemd:
+    state: restarted
+    name: apache2
+
+- name: Create koha instance
+  become: yes
+  command:
+    cmd: koha-create --create-db "{{library_name}}"
+
+- name: Enable the Apache2 module cgi
+  become: yes
+  apache2_module:
+    state: present
+    name: headers
+
+- name: Enable the Apache2 module cgi
+  become: yes
+  apache2_module:
+    state: present
+    name: proxy_http
+
+- name: Enable plack
+  become: yes
+  command:
+    cmd: koha-plack --enable "{{library_name}}"
+
+- name: Start plack
+  become: yes
+  command:
+    cmd: koha-plack --start "{{library_name}}"
+
+- name: Make sure apache2 is restarted
+  become: yes
+  systemd:
+    state: restarted
+    name: apache2
+
+
+

+ 52 - 0
roles/koha/templates/koha-sites.conf.j2

@@ -0,0 +1,52 @@
+# NOTE: for a complete list of valid options please read koha-create(8)
+
+## Apache virtual hosts creation variables
+#
+# Please note that the URLs are built like this:
+# OPAC:  http://<OPACPREFIX><INSTANCE NAME><OPACSUFFIX><DOMAIN>:<OPACPORT>
+# STAFF: http://<INTRAPREFIX><INSTANCE NAME><INTRASUFFIX><DOMAIN>:<INTRAPORT>
+DOMAIN=".{{domain}}"
+INTRAPORT="80"
+INTRAPREFIX=""
+INTRASUFFIX="-intra"
+OPACPORT="80"
+OPACPREFIX=""
+OPACSUFFIX=""
+
+## Default data to be loaded
+#
+# DEFAULTSQL: filename
+# Specify an SQL file with default data to load during instance creation
+# The SQL file can be optionally compressed with gzip
+# default: (empty)
+DEFAULTSQL=""
+
+## Zebra global configuration variables
+#
+# ZEBRA_MARC_FORMAT: 'marc21' | 'unimarc'
+# Specifies the MARC records format for indexing
+# default: 'marc21'
+ZEBRA_MARC_FORMAT="marc21"
+
+# ZEBRA_LANGUAGE: 'cs' | 'el' | 'en' | 'es' | 'fr' | 'nb' | 'ru' | 'uk'
+# Primary language for Zebra indexing
+# default: 'en'
+ZEBRA_LANGUAGE="en"
+
+## Memcached global configuration variables
+#
+# USE_MEMCACHED: 'yes' | 'no'
+# Make the created instance use memcached. Can be altered later.
+# default: 'yes'
+USE_MEMCACHED="yes"
+
+# MEMCACHED_SERVERS: comma separated list of memcached servers (ip:port)
+# Specify a list of memcached servers for the Koha instance
+# default: '127.0.0.1:11211'
+MEMCACHED_SERVERS="127.0.0.1:11211"
+
+# MEMCACHED_PREFIX:
+# Specify a string to be used as prefix for defining the memcached namespace
+# for the created instance.
+# default: 'koha_'
+MEMCACHED_PREFIX="koha_"

+ 4 - 0
vars/koha.yml

@@ -0,0 +1,4 @@
+---
+domain: cisti.org
+library_name: goliarda
+