diff --git a/abusesa/manifests/live.pp b/abusesa/manifests/live.pp index 7c72d79..1384592 100644 --- a/abusesa/manifests/live.pp +++ b/abusesa/manifests/live.pp @@ -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", } } diff --git a/abusesa/templates/live/config.json.erb b/abusesa/templates/live/config.json.erb index 10aa204..4bf7994 100644 --- a/abusesa/templates/live/config.json.erb +++ b/abusesa/templates/live/config.json.erb @@ -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) %>