diff --git a/vsroom/files/config.json b/vsroom/files/config.json deleted file mode 100644 index 4ac2ae1..0000000 --- a/vsroom/files/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "authUrl": "../common/auth_credentials.php", - "boshUrl": "/bosh/" -} diff --git a/vsroom/manifests/init.pp b/vsroom/manifests/init.pp index 48d9915..4895c82 100644 --- a/vsroom/manifests/init.pp +++ b/vsroom/manifests/init.pp @@ -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"], } diff --git a/vsroom/templates/config.json.erb b/vsroom/templates/config.json.erb new file mode 100644 index 0000000..034724a --- /dev/null +++ b/vsroom/templates/config.json.erb @@ -0,0 +1,4 @@ +{ + "authUrl": "<%= vsroom_authurl %>", + "boshUrl": "<%= vsroom_boshurl %>" +}