diff --git a/python/manifests/init.pp b/python/manifests/init.pp index 1e4d3c6..76ebc00 100644 --- a/python/manifests/init.pp +++ b/python/manifests/init.pp @@ -93,7 +93,7 @@ define python::setup::install($python="python", $source="") { exec { "python-setup-install-${name}": path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", cwd => $name, - command => "/bin/sh -c 'umask 022; ${python} setup.py install'", + command => "/bin/sh -c 'umask 022; ${python} setup.py install && mkdir -p build'", creates => "${name}/build", } diff --git a/vsroom/manifests/init.pp b/vsroom/manifests/init.pp index 2a9258a..4c2a8ee 100644 --- a/vsroom/manifests/init.pp +++ b/vsroom/manifests/init.pp @@ -8,18 +8,22 @@ # $boshurl: # XMPP BOSH path. Defaults to "/bosh/". # +# $config: +# Source URL of custom config file. +# # $webhosts: -# List of vsroom virtual hosts +# List of vsroom virtual hosts. # class vsroom( $authurl="/collab/?action=authcredentials", $boshurl="/bosh/", - $webhosts=undef + $config=undef, + $webhosts=undef, ) { - if !$vsroom_package { - if $vsroom_package_latest { - $vsroom_package = $vsroom_package_latest + if ! $vsroom_package { + if $::vsroom_package_latest { + $vsroom_package = $::vsroom_package_latest } else { fail("Must define \$vsroom_package or \$vsroom_package_latest") } @@ -37,17 +41,9 @@ class vsroom( 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": } + python::setup::install { "/usr/local/src/vsroom": + require => Util::Extract::Tar["/usr/local/src/vsroom"], } $htdocs = $::operatingsystem ? { @@ -55,12 +51,19 @@ class vsroom( 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", - content => template("vsroom/config.json.erb"), + source => $config, + content => $config_content, require => Python::Setup::Install["/usr/local/src/vsroom"], }