abusesa: Generate Live config with JSON.generate, add mapurl parameter

This commit is contained in:
Ossi Salmi 2015-11-30 12:08:28 +00:00
parent a0453bfd16
commit 9d75a9a706
2 changed files with 19 additions and 4 deletions

View file

@ -17,6 +17,7 @@
class abusesa::live(
$authurl='/collab/?action=authcredentials',
$boshurl='/bosh/',
$mapurl=undef,
$config=undef,
$webhosts=undef,
) {
@ -106,7 +107,7 @@ define abusesa::live::configwebhost($htdocs) {
mode => '0644',
owner => 'root',
group => 'root',
content => "RedirectMatch permanent /vsroom/overview/(index\.html)? /abusesa/live/\n",
content => "RedirectMatch permanent /vsroom/overview/(index\\.html)? /abusesa/live/\n",
}
}

View file

@ -1,4 +1,18 @@
{
"authUrl": "<%= @authurl %>",
"boshUrl": "<%= @boshurl %>"
<%
require 'json'
config = {
'authUrl' => @authurl,
'boshUrl' => @boshurl,
}
if @mapurl
config['viewPlugins'] = [{
'id' => 'map',
'name' => 'Map',
'type' => 'PolymapsView',
'settings' => { 'mapUrl' => @mapurl },
}]
end
-%>
<%= JSON.generate(config) %>