84 lines
2.3 KiB
Puppet
84 lines
2.3 KiB
Puppet
# Install VSRoom.
|
|
#
|
|
# === Parameters
|
|
#
|
|
# $authurl:
|
|
# Authentication path. Defaults to "/collab/?action=authcredentials".
|
|
#
|
|
# $boshurl:
|
|
# XMPP BOSH path. Defaults to "/bosh/".
|
|
#
|
|
# $webhosts:
|
|
# List of vsroom virtual hosts
|
|
#
|
|
class vsroom($authurl="/collab/?action=authcredentials",
|
|
$boshurl="/bosh/",
|
|
$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"],
|
|
before => Python::Setup::Install["/usr/local/src/vsroom"],
|
|
}
|
|
|
|
if $::operatingsystem in ["CentOS","RedHat"] and versioncmp($::operatingsystemrelease, "6") < 0 {
|
|
include python::python26
|
|
python::setup::install { "/usr/local/src/vsroom":
|
|
python => "python2.6",
|
|
require => Package["python26"],
|
|
}
|
|
} else {
|
|
python::setup::install { "/usr/local/src/vsroom": }
|
|
}
|
|
|
|
$htdocs = $::operatingsystem ? {
|
|
"ubuntu" => "/usr/local/share/vsroom/htdocs",
|
|
default => "/usr/share/vsroom/htdocs",
|
|
}
|
|
|
|
file { "${htdocs}/config.json":
|
|
ensure => present,
|
|
mode => "0644",
|
|
owner => "root",
|
|
group => "root",
|
|
content => template("vsroom/config.json.erb"),
|
|
require => Python::Setup::Install["/usr/local/src/vsroom"],
|
|
}
|
|
|
|
define configwebhost($htdocs) {
|
|
file { "/srv/www/https/${name}/vsroom":
|
|
ensure => link,
|
|
target => $htdocs,
|
|
require => File["/srv/www/https/${name}"],
|
|
}
|
|
}
|
|
|
|
if $webhosts {
|
|
apache::configfile { "vsroom.conf":
|
|
http => false,
|
|
source => "puppet:///modules/vsroom/vsroom-httpd.conf",
|
|
}
|
|
|
|
configwebhost { $webhosts:
|
|
htdocs => $htdocs,
|
|
}
|
|
}
|
|
|
|
}
|