Compare commits
No commits in common. "cbe9cd69463d6b713a3d109c22c4331c1047a12d" and "5f7d4fa5f3dac3fbab0cd8a48ec2e1af5e3f47aa" have entirely different histories.
cbe9cd6946
...
5f7d4fa5f3
8 changed files with 90 additions and 155 deletions
8
koha.yml
8
koha.yml
|
@ -1,8 +0,0 @@
|
||||||
---
|
|
||||||
## KOHA
|
|
||||||
- name: Koha
|
|
||||||
hosts: localhost
|
|
||||||
roles: ['stable/common', 'koha']
|
|
||||||
vars_files: vars/koha.yml
|
|
||||||
tags: koha
|
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
---
|
|
||||||
## 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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
# 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_"
|
|
|
@ -7,7 +7,7 @@ log_level: "INFO"
|
||||||
database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/db_password create=True nosymbols=true')}}"
|
database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/db_password create=True nosymbols=true')}}"
|
||||||
pad_admin_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/admin_password create=True nosymbols=true')}}"
|
pad_admin_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/admin_password create=True nosymbols=true')}}"
|
||||||
|
|
||||||
plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align']
|
plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align', 'ep_delete_after_delay_lite']
|
||||||
|
|
||||||
pad_lang: 'it-IT'
|
pad_lang: 'it-IT'
|
||||||
|
|
||||||
|
|
|
@ -26,16 +26,14 @@
|
||||||
become_user: "etherpad"
|
become_user: "etherpad"
|
||||||
register: repository
|
register: repository
|
||||||
|
|
||||||
- name: ensure etherpad service is latest
|
- name: ensure etherpad init.d is latest
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: etherpad.service.j2
|
src: etherpad.initd.j2
|
||||||
src: etherpad.service.j2
|
dest: /etc/init.d/etherpad
|
||||||
dest: /etc/systemd/system/etherpad.service
|
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0500
|
||||||
notify: systemd reload
|
|
||||||
|
|
||||||
- name: copy etherpad settings.json
|
- name: copy etherpad settings.json
|
||||||
become: yes
|
become: yes
|
||||||
|
|
77
roles/stable/etherpad/templates/etherpad.initd.j2
Normal file
77
roles/stable/etherpad/templates/etherpad.initd.j2
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: etherpad-lite
|
||||||
|
# Required-Start: $local_fs $remote_fs $network $syslog
|
||||||
|
# Required-Stop: $local_fs $remote_fs $network $syslog
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: starts etherpad lite
|
||||||
|
# Description: starts etherpad lite using start-stop-daemon
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
|
||||||
|
LOGFILE="/srv/etherpad/etherpad/etherpad-lite.log"
|
||||||
|
EPLITE_DIR="/srv/etherpad/etherpad"
|
||||||
|
EPLITE_BIN="bin/safeRun.sh"
|
||||||
|
USER="etherpad"
|
||||||
|
GROUP="etherpad"
|
||||||
|
DESC="Etherpad Lite"
|
||||||
|
NAME="etherpad-lite"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
start() {
|
||||||
|
echo "Starting $DESC... "
|
||||||
|
|
||||||
|
start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
|
||||||
|
echo "done"
|
||||||
|
}
|
||||||
|
|
||||||
|
#We need this function to ensure the whole process tree will be killed
|
||||||
|
killtree() {
|
||||||
|
local _pid=$1
|
||||||
|
local _sig=${2-TERM}
|
||||||
|
for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
|
||||||
|
killtree ${_child} ${_sig}
|
||||||
|
done
|
||||||
|
kill -${_sig} ${_pid}
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo "Stopping $DESC... "
|
||||||
|
while test -d /proc/$(cat /var/run/$NAME.pid); do
|
||||||
|
killtree $(cat /var/run/$NAME.pid) 15
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
|
rm /var/run/$NAME.pid
|
||||||
|
echo "done"
|
||||||
|
}
|
||||||
|
|
||||||
|
status() {
|
||||||
|
status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $NAME {start|stop|restart|status}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
|
@ -545,6 +545,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"ep_delete_after_delay_lite": {
|
||||||
|
"delay": 86400, // one day, in seconds
|
||||||
|
"loop": true,
|
||||||
|
"loopDelay": 3600, // one hour, in seconds
|
||||||
|
"deleteAtStart": true,
|
||||||
|
"text": "{{pad_default_text|replace("\n","\\n")}}"
|
||||||
|
},
|
||||||
|
|
||||||
"ep_toc": {
|
"ep_toc": {
|
||||||
"disable_by_default": true
|
"disable_by_default": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
---
|
|
||||||
domain: cisti.org
|
|
||||||
library_name: goliarda
|
|
||||||
|
|
Loading…
Reference in a new issue