94 lines
2.2 KiB
Puppet
94 lines
2.2 KiB
Puppet
# Install VSRoom.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# $authurl:
|
|
# Authentication path. Defaults to "/collab/?action=authcredentials".
|
|
#
|
|
# $boshurl:
|
|
# XMPP BOSH path. Defaults to "/bosh/".
|
|
#
|
|
# $config:
|
|
# Source URL of custom config file.
|
|
#
|
|
# $webhosts:
|
|
# List of vsroom virtual hosts.
|
|
#
|
|
class vsroom(
|
|
$authurl="/collab/?action=authcredentials",
|
|
$boshurl="/bosh/",
|
|
$config=undef,
|
|
$webhosts=undef,
|
|
) {
|
|
|
|
if ! $vsroom_package {
|
|
if $::vsroom_package_latest {
|
|
$vsroom_package = $::vsroom_package_latest
|
|
} else {
|
|
fail("Must define \$vsroom_package or \$vsroom_package_latest")
|
|
}
|
|
}
|
|
|
|
file { "/usr/local/src/vsroom.tar.gz":
|
|
ensure => present,
|
|
mode => "0644",
|
|
owner => "root",
|
|
group => "root",
|
|
source => "puppet:///files/packages/${vsroom_package}",
|
|
}
|
|
util::extract::tar { "/usr/local/src/vsroom":
|
|
ensure => latest,
|
|
strip => 1,
|
|
source => "/usr/local/src/vsroom.tar.gz",
|
|
require => File["/usr/local/src/vsroom.tar.gz"],
|
|
}
|
|
python::setup::install { "/usr/local/src/vsroom":
|
|
require => Util::Extract::Tar["/usr/local/src/vsroom"],
|
|
}
|
|
|
|
$htdocs = $::operatingsystem ? {
|
|
"ubuntu" => "/usr/local/share/vsroom/htdocs",
|
|
default => "/usr/share/vsroom/htdocs",
|
|
}
|
|
|
|
if $config {
|
|
$config_content = undef
|
|
} else {
|
|
$config_content = template("vsroom/config.json.erb")
|
|
}
|
|
|
|
file { "${htdocs}/config.json":
|
|
ensure => present,
|
|
mode => "0644",
|
|
owner => "root",
|
|
group => "root",
|
|
source => $config,
|
|
content => $config_content,
|
|
require => Python::Setup::Install["/usr/local/src/vsroom"],
|
|
}
|
|
|
|
if $webhosts {
|
|
apache::configfile { "vsroom.conf":
|
|
http => false,
|
|
source => "puppet:///modules/vsroom/vsroom-httpd.conf",
|
|
}
|
|
|
|
vsroom::configwebhost { $webhosts:
|
|
htdocs => $htdocs,
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# Enable vsroom for virtual host.
|
|
#
|
|
define vsroom::configwebhost($htdocs) {
|
|
|
|
file { "/srv/www/https/${name}/vsroom":
|
|
ensure => link,
|
|
target => $htdocs,
|
|
require => File["/srv/www/https/${name}"],
|
|
}
|
|
|
|
}
|