Allow system nodejs install
Allow setting the nodejs_version to 'system' which will tell the module to install the nodejs and npm packages from their system package manager rather than building the specified version from source, and symlink the expected interpreter name. Change-Id: I9831526581a5fc1f2014c9985637664c79b937bf
This commit is contained in:
parent
cc8e0cbad8
commit
6a254faec5
@ -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,46 +45,63 @@ class etherpad_lite (
|
||||
mode => '0664',
|
||||
}
|
||||
|
||||
vcsrepo { "${base_install_dir}/nodejs":
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/joyent/node.git',
|
||||
revision => $nodejs_version,
|
||||
require => [
|
||||
Package['git'],
|
||||
File[$base_install_dir],
|
||||
],
|
||||
if ($nodejs_version != 'system') {
|
||||
vcsrepo { "${base_install_dir}/nodejs":
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/joyent/node.git',
|
||||
revision => $nodejs_version,
|
||||
require => [
|
||||
Package['git'],
|
||||
File[$base_install_dir],
|
||||
],
|
||||
}
|
||||
|
||||
package { [
|
||||
'gzip',
|
||||
'curl',
|
||||
'python',
|
||||
'libssl-dev',
|
||||
'pkg-config',
|
||||
'abiword',
|
||||
'build-essential',
|
||||
]:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package { ['nodejs', 'npm']:
|
||||
ensure => purged,
|
||||
}
|
||||
|
||||
buildsource { "${base_install_dir}/nodejs":
|
||||
timeout => 900, # 15 minutes
|
||||
creates => '/usr/local/bin/node',
|
||||
require => [
|
||||
Package['gzip'],
|
||||
Package['curl'],
|
||||
Package['python'],
|
||||
Package['libssl-dev'],
|
||||
Package['pkg-config'],
|
||||
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'],
|
||||
}
|
||||
}
|
||||
|
||||
package { [
|
||||
'gzip',
|
||||
'curl',
|
||||
'python',
|
||||
'libssl-dev',
|
||||
'pkg-config',
|
||||
'abiword',
|
||||
'build-essential',
|
||||
]:
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package { ['nodejs', 'npm']:
|
||||
ensure => purged,
|
||||
}
|
||||
|
||||
buildsource { "${base_install_dir}/nodejs":
|
||||
timeout => 900, # 15 minutes
|
||||
creates => '/usr/local/bin/node',
|
||||
require => [
|
||||
Package['gzip'],
|
||||
Package['curl'],
|
||||
Package['python'],
|
||||
Package['libssl-dev'],
|
||||
Package['pkg-config'],
|
||||
Package['build-essential'],
|
||||
Vcsrepo["${base_install_dir}/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