summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-05-28 22:34:33 -0400
committerSimo Sorce <simo@redhat.com>2014-06-04 10:26:34 -0400
commit2bf19529aed9bc545fadf60f06b4e8ee78483ca2 (patch)
treecc7eddc520240b8a581fd0e8614f5259cbf76c82
parentd5226ac4c37b38c51a1e0de1835488432723995f (diff)
downloadipsilon.git-2bf19529aed9bc545fadf60f06b4e8ee78483ca2.tar.gz
ipsilon.git-2bf19529aed9bc545fadf60f06b4e8ee78483ca2.tar.xz
ipsilon.git-2bf19529aed9bc545fadf60f06b4e8ee78483ca2.zip
Additional parametrization of template files
To allow for testing in a custom rootdir, and with a custom user. Signed-off-by: Simo Sorce <simo@redhat.com>
-rwxr-xr-xipsilon/install/ipsilon-server-install8
-rw-r--r--templates/install/idp.conf10
-rw-r--r--templates/install/ipsilon.conf2
3 files changed, 13 insertions, 7 deletions
diff --git a/ipsilon/install/ipsilon-server-install b/ipsilon/install/ipsilon-server-install
index 3e9ca10..844505c 100755
--- a/ipsilon/install/ipsilon-server-install
+++ b/ipsilon/install/ipsilon-server-install
@@ -39,6 +39,8 @@ TEMPLATES = '/usr/share/ipsilon/templates/install'
CONFDIR = '/etc/ipsilon'
DATADIR = '/var/lib/ipsilon'
HTTPDCONFD = '/etc/httpd/conf.d'
+BINDIR = '/usr/sbin'
+STATICDIR = '/usr/share/ipsilon'
class ConfigurationError(Exception):
@@ -95,7 +97,11 @@ def install(plugins, args):
shutil.move(idp_conf, '%s.backup.%s' % (idp_conf, now))
if not os.path.exists(instance_conf):
os.makedirs(instance_conf, 0700)
- confopts = {'instance': args['instance'], 'datadir': args['data_dir']}
+ confopts = {'instance': args['instance'],
+ 'datadir': args['data_dir'],
+ 'sysuser': args['system_user'],
+ 'ipsilondir': BINDIR,
+ 'staticdir': STATICDIR}
files.write_from_template(ipsilon_conf,
os.path.join(TEMPLATES, 'ipsilon.conf'),
confopts)
diff --git a/templates/install/idp.conf b/templates/install/idp.conf
index 4fe4204..6175ffe 100644
--- a/templates/install/idp.conf
+++ b/templates/install/idp.conf
@@ -1,15 +1,15 @@
-Alias /${instance}/ui /usr/share/ipsilon/ui
-WSGIScriptAlias /${instance} /usr/sbin/ipsilon
-WSGIDaemonProcess ${instance} user=ipsilon group=ipsilon home=${datadir}
+Alias /${instance}/ui ${staticdir}/ui
+WSGIScriptAlias /${instance} ${ipsilondir}/ipsilon
+WSGIDaemonProcess ${instance} user=${sysuser} group=${sysuser} home=${datadir}
<Location /${instance}>
WSGIProcessGroup ${instance}
</Location>
-<Directory /usr/sbin>
+<Directory ${ipsilondir}>
Require all granted
</Directory>
-<Directory /usr/share/ipsilon>
+<Directory ${staticdir}>
Require all granted
</Directory>
diff --git a/templates/install/ipsilon.conf b/templates/install/ipsilon.conf
index 3c9226f..89e14f1 100644
--- a/templates/install/ipsilon.conf
+++ b/templates/install/ipsilon.conf
@@ -3,7 +3,7 @@ debug = False
log.screen = False
base.mount = "/${instance}"
-base.dir = "/usr/share/ipsilon"
+base.dir = "${staticdir}"
admin.config.db = "${datadir}/adminconfig.sqlite"
user.prefs.db = "${datadir}/userprefs.sqlite"