-
Notifications
You must be signed in to change notification settings - Fork 0
/
kohalxc.conf
132 lines (118 loc) · 5.41 KB
/
kohalxc.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
# File: $KOHALXC_ROOTDIR/kohalxc.conf
# #############################################################################
# Code is part of KohaLXC/kohatools Ansible/Bash tooling scripts environment
# for Koha/ILS-development, deployment & database conversion/migration tasks.
# Author: Jukka Aaltonen, Koha-Lappi, Rovaniemi City Library, Lapland/Finland.
# License: Gnu General Public License version 3.
#
# Description:
# KohaLXC-script settings (kohalxc.conf) sourcing rest of kohatools/setup envs:
# - settings to configure, create, start/stop, destroy and use Koha-LXC/hosts
#
# Created: 2016-08-15 by "roikohadev" (@jjaone)
# History:
# #############################################################################
## [verbose]: show the 'kohalxc-environment that have been set previously .."
[[ -n "$VERBOSE" ]] && env | grep KOHALXC | sort
#######################################
# Settings: Tool & Koha Setup env
#######################################
## Set the KOHALXVC tools/config environment
# This script
KOHALXC_SCRIPT="${app:-kohalxc}"
# USER HOME RC-file
KOHALXC_RC="$HOME/.kohalxc.rc"
# Koha-works main directory
KOHALXC_WORKS="${KOHALXC_WORKS:-$HOME/Works}"
# KohaLXC-organization (i.e. "KohaLappi" or "KohaSuomi" )
KOHALXC_ORGANIZATION="${KOHALXC_ORGANIZATION:-KohaSuomi}"
# KohaLXC-tools main directory
KOHALXC_ROOTDIR="${KOHALXC_ROOTDIR:-$HOME/Works/KohaLXC}"
# KohaLXC-kohasetup tools main directory (to be used mainly in containers)
KOHALXC_TOOLDIR="${KOHALXC_TOOLDIR:-$KOHALXC_ROOTDIR/kohatools}"
# Folder for koha-configs and setups, to be used in host and also in containers (dirname)
KOHALXC_CONFIGDIR="config"
# Kohalcx container-specific main configuration (filename)
KOHALXC_CONFIGFILE="kohalxc.conf"
# The LXC-config to be generated (filename)
KOHALXC_LXCCONFIG="config.conf"
# The Ansible/YAML LXC-definition (filename)
KOHALXC_LXCYAML="lxc.yaml"
# The Ansible/YAML LXC-related facts (filename)
KOHALXC_LXCFACT="lxc.fact"
# Folder for koha-lxc -specific logs (dirname)
KOHALXC_LOGDIR="logs"
# Web panel tool (lwp) for LXC-containers in http://localost:5000
KOHALXC_LWP_SCRIPT="${KOHALXC_LWP_SCRIPT:-$HOME/bin/lwp}"
KOHALXC_LWP_URL="${KOHALXC_LWP_URL:-$http://localhost:5000}"
## KohaLXC-containers setup settings
# Main directory for Koha-LXC containers setups/configs
KOHALXC_SETUPDIR="${KOHALXC_SETUPDIR:-$KOHALXC_WORKS/$KOHALXC_ORGANIZATION/kohalxc}"
# Backup dir of Koha-LXC container setups/configs
KOHALXC_SETUPDIR_BACKUP="${KOHALXC_SETUPDIR}-backup"
# List of all configured/setup LXC-containers that we have
KOHALXC_LXCs=
# Container name, e.g.tkldev_mdbc9, xklprod_ksgitc9, to be set later..
KOHALXC_NAME=""
# (set later in 'kohalxc') The dir for named LXC-setups
# - KOHALXC_SETUP="$KOHALXC_SETUPDIR/$KOHALXC_NAME"
KOHALXC_SETUP=
# (set later in 'kohalxc') Container-specific configs KOHALXC-setup dir
# - KOHALXC_SETUP_CONFIGDIR="$KOHALXC_SETUP/$KOHALXC_CONFIGDIR"
KOHALXC_SETUP_CONFIGDIR=
# (set later in 'kohalxc') Container-specific logs kept under KOHALXC-setup dir
# - KOHALXC_SETUP_LOGDIR="$KOHALXC_SETUP/$KOHALXC_LOGDIR"
KOHALXC_SETUP_LOGDIR=
# (set later in 'kohalxc') Full path to container logfile..
#- KOHALXC_SETUP_LOGFILE="$KOHALXC_SETUP_LOGDIR/$KOHALXC_NAME.log"
KOHALXC_SETUP_LOGFILE=
# FATAL,CRIT,WARN,ERROR,(NOTICE),INFO,DEBUG.
KOHALXC_LOGLEVEL="${KOHALXC_LOGLEVEL:-NOTICE}"
## Defaults/details about specific container
# Description
KOHALXC_INFO="Ubuntu Xenial kohalappi dev from KS Git (3.16 master)"
# Distro details
KOHALXC_DISTRO="Ubuntu 16.04 Xenial LTS"
# Container Ubuntu release: xenial | trusty
KOHALXC_RELEASE="${KOHALXC_RELEASE:-xenial}"
# KOHALXC-setup variant: dev | test | prod
KOHALXC_VARIANT="${KOHALXC_VARIANT:-dev}"
KOHALXC_PACKAGES="joe,wget,git"
KOHALXC_SSHKEY="~/.ssh/id_rsa.pub"
KOHALXC_OPTS1="--packages KOHALXC_PACKAGES"
KOHALXC_OPTS2="--auth-key $KOHALXC_SSHKEY"
#KOHALXC_GITUSER=
#KOHALXC_GITEMAIL=
KOHALXC_AUTHOR="${kOHALXC_AUTHOR:-Koha Developer}"
KOHALXC_CREATED=`date +%Y-%m-%d`
KOHALXC_SERVER_SSHUSER="${KOHALXC_SERVER_SSHUSER:-ubuntu}"
KOHALXC_SERVER_SSHCMD="whoami && pwd && ls -la"
KOHALXC_SERVER_KOHALXC="home/$KOHALXC_SERVER_SSHUSER/kohalxc"
KOHALXC_SERVER_KOHATOOLS="home/$KOHALXC_SERVER_SSHUSER/kohatools"
## Path where lxc-containers are
KOHALXC_LXCPATH="${KOHALXC_LXCPATH:-/var/lib/lxc}"
## Ansible configuration manager root directory
KOHALXC_ANSIBLE_ROOTDIR="${KOHALXC_ROOTDIR}/kohaplay"
## Ansible configuration manager playbook directory
KOHALXC_ANSIBLE_PLAYBOOKS="${KOHALXC_ANSIBLE_ROOTDIR}/kohalappi"
## Ansible configuration manager main playbook (relative to playbook dir)
KOHALXC_ANSIBLE_PLAYBOOK="play-all.yaml"
## Ansible configuration manager playbook inventory (relative to playbook dir)
# - localdev, development, testing, monitoring, production etc.
KOHALXC_ANSIBLE_INVENTORY="localdev"
# Ignore ':debug' -tasks in plays (unless -d has been given)
KOHALXC_ANSIBLE_SKIPTAGS="--skip-tags=common:bootstrap,common:debug,hostnode:debug,lxcs:debug"
## Ansible configuration manager command line args
KOHALXC_ANSIBLE_CMDOPTS="--vault-password-file .vault.pass.txt"
## Finally, source the 'kohatools/kohasetup common settings/functions--'
if [[ -f "$KOHALXC_TOOLDIR/conf.d/kohasetup.conf" ]]; then
source $KOHALXC_TOOLDIR/conf.d/kohasetup.conf
if [[ ! "$?" -eq 0 ]]; then
echo "== Failed sourcing: $KOHALXC_TOOLDIR/conf.d/kohasetup.conf"
exit 1
fi
else
echo "== File not found: $KOHALXC_TOOLDIR/conf.d/kohasetup.conf"
exit 2
fi