Merge "Allow system nodejs install"
This commit is contained in:
commit
021bc83b28
@ -15,6 +15,7 @@ class etherpad_lite (
|
||||
$ep_user = 'eplite',
|
||||
$base_log_dir = '/var/log',
|
||||
$base_install_dir = '/opt/etherpad-lite',
|
||||
# If set to system will install system package.
|
||||
$nodejs_version = 'v0.10.21',
|
||||
$eplite_version = 'develop',
|
||||
$ep_ensure = 'present',
|
||||
@ -44,6 +45,7 @@ class etherpad_lite (
|
||||
mode => '0664',
|
||||
}
|
||||
|
||||
if ($nodejs_version != 'system') {
|
||||
vcsrepo { "${base_install_dir}/nodejs":
|
||||
ensure => present,
|
||||
provider => git,
|
||||
@ -83,7 +85,23 @@ class etherpad_lite (
|
||||
Package['build-essential'],
|
||||
Vcsrepo["${base_install_dir}/nodejs"],
|
||||
],
|
||||
before => Anchor['nodejs-anchor'],
|
||||
}
|
||||
} else {
|
||||
package { ['nodejs', 'npm']:
|
||||
ensure => present,
|
||||
before => Anchor['nodejs-anchor'],
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/node':
|
||||
ensure => link,
|
||||
target => '/usr/bin/nodejs',
|
||||
before => Anchor['nodejs-anchor'],
|
||||
require => Package['nodejs'],
|
||||
}
|
||||
}
|
||||
|
||||
anchor { 'nodejs-anchor': }
|
||||
|
||||
vcsrepo { "${base_install_dir}/etherpad-lite":
|
||||
ensure => $ep_ensure,
|
||||
@ -105,7 +123,7 @@ class etherpad_lite (
|
||||
environment => "HOME=${base_log_dir}/${ep_user}",
|
||||
require => [
|
||||
Vcsrepo["${base_install_dir}/etherpad-lite"],
|
||||
Buildsource["${base_install_dir}/nodejs"],
|
||||
Anchor['nodejs-anchor'],
|
||||
],
|
||||
before => File["${base_install_dir}/etherpad-lite/settings.json"],
|
||||
creates => "${base_install_dir}/etherpad-lite/node_modules",
|
||||
|
Loading…
x
Reference in New Issue
Block a user