Added support for collab auth in vsroom, templated config.json

Class vsroom::collab installs auth_credentials.php in collab htdocs and
sets the authUrl variable in config.json accordingly.
This commit is contained in:
Ossi Salmi 2012-06-18 10:09:06 +03:00
parent b1401f4c04
commit fabf5e90cb
3 changed files with 56 additions and 8 deletions

View file

@ -1,4 +0,0 @@
{
"authUrl": "../common/auth_credentials.php",
"boshUrl": "/bosh/"
}

View file

@ -1,7 +1,57 @@
# Install vsroom.
# Install standalone vsroom.
#
# === Global variables
#
# $vsroom_authurl:
# Authentication path. Defaults to "../common/auth_credentials.php".
#
# $vsroom_boshurl:
# XMPP BOSH path. Defaults to "/bosh/".
#
class vsroom {
if !$vsroom_authurl {
$vsroom_authurl = "../common/auth_credentials.php"
}
if !$vsroom_boshurl {
$vsroom_boshurl = "/bosh/"
}
include vsroom::common
}
# Install vsroom with collab authentication.
#
class vsroom::collab {
if !$vsroom_authurl {
$vsroom_authurl = "/collab/auth_credentials.php"
}
if !$vsroom_boshurl {
$vsroom_boshurl = "/bosh/"
}
include vsroom::common
file { "/srv/wikis/collab/htdocs/auth_credentials.php":
ensure => present,
mode => "0660",
owner => "collab",
group => "collab",
source => "/usr/share/vsroom/htdocs/common/auth_credentials.php",
require => [ File["/srv/wikis/collab/htdocs"],
Python::Setup::Install["/usr/local/src/vsroom"], ],
}
}
# Install common vsroom components.
#
class vsroom::common {
case $operatingsystem {
centos: {
case $operatingsystemrelease {
@ -75,9 +125,7 @@ class vsroom {
mode => "0644",
owner => "root",
group => "root",
source => [ "puppet:///files/vsroom/config.json.${fqdn}",
"puppet:///files/vsroom/config.json",
"puppet:///modules/vsroom/config.json", ],
content => template("vsroom/config.json.erb"),
require => Python::Setup::Install["/usr/local/src/vsroom"],
}

View file

@ -0,0 +1,4 @@
{
"authUrl": "<%= vsroom_authurl %>",
"boshUrl": "<%= vsroom_boshurl %>"
}