summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-08-21 13:58:33 +0000
committerGerrit Code Review <review@openstack.org>2015-08-21 13:58:33 +0000
commit021bc83b283e091cc6dd73d96c849881dfe98e50 (patch)
tree7f550efebbcaa4e1dd8357966698a950b9ad9fb1
parente9dc09a9b30b45c5f9a9b47b0dea35ec924b8df1 (diff)
parent6a254faec50a641e9c766a4fd671169e70b49dac (diff)
Merge "Allow system nodejs install"
-rw-r--r--manifests/init.pp92
1 files changed, 55 insertions, 37 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 30b7f9b..08cdfce 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -15,6 +15,7 @@ class etherpad_lite (
15 $ep_user = 'eplite', 15 $ep_user = 'eplite',
16 $base_log_dir = '/var/log', 16 $base_log_dir = '/var/log',
17 $base_install_dir = '/opt/etherpad-lite', 17 $base_install_dir = '/opt/etherpad-lite',
18 # If set to system will install system package.
18 $nodejs_version = 'v0.10.21', 19 $nodejs_version = 'v0.10.21',
19 $eplite_version = 'develop', 20 $eplite_version = 'develop',
20 $ep_ensure = 'present', 21 $ep_ensure = 'present',
@@ -44,47 +45,64 @@ class etherpad_lite (
44 mode => '0664', 45 mode => '0664',
45 } 46 }
46 47
47 vcsrepo { "${base_install_dir}/nodejs": 48 if ($nodejs_version != 'system') {
48 ensure => present, 49 vcsrepo { "${base_install_dir}/nodejs":
49 provider => git, 50 ensure => present,
50 source => 'https://github.com/joyent/node.git', 51 provider => git,
51 revision => $nodejs_version, 52 source => 'https://github.com/joyent/node.git',
52 require => [ 53 revision => $nodejs_version,
53 Package['git'], 54 require => [
54 File[$base_install_dir], 55 Package['git'],
55 ], 56 File[$base_install_dir],
56 } 57 ],
58 }
57 59
58 package { [ 60 package { [
59 'gzip', 61 'gzip',
60 'curl', 62 'curl',
61 'python', 63 'python',
62 'libssl-dev', 64 'libssl-dev',
63 'pkg-config', 65 'pkg-config',
64 'abiword', 66 'abiword',
65 'build-essential', 67 'build-essential',
66 ]: 68 ]:
67 ensure => present, 69 ensure => present,
68 } 70 }
69 71
70 package { ['nodejs', 'npm']: 72 package { ['nodejs', 'npm']:
71 ensure => purged, 73 ensure => purged,
72 } 74 }
73 75
74 buildsource { "${base_install_dir}/nodejs": 76 buildsource { "${base_install_dir}/nodejs":
75 timeout => 900, # 15 minutes 77 timeout => 900, # 15 minutes
76 creates => '/usr/local/bin/node', 78 creates => '/usr/local/bin/node',
77 require => [ 79 require => [
78 Package['gzip'], 80 Package['gzip'],
79 Package['curl'], 81 Package['curl'],
80 Package['python'], 82 Package['python'],
81 Package['libssl-dev'], 83 Package['libssl-dev'],
82 Package['pkg-config'], 84 Package['pkg-config'],
83 Package['build-essential'], 85 Package['build-essential'],
84 Vcsrepo["${base_install_dir}/nodejs"], 86 Vcsrepo["${base_install_dir}/nodejs"],
85 ], 87 ],
88 before => Anchor['nodejs-anchor'],
89 }
90 } else {
91 package { ['nodejs', 'npm']:
92 ensure => present,
93 before => Anchor['nodejs-anchor'],
94 }
95
96 file { '/usr/local/bin/node':
97 ensure => link,
98 target => '/usr/bin/nodejs',
99 before => Anchor['nodejs-anchor'],
100 require => Package['nodejs'],
101 }
86 } 102 }
87 103
104 anchor { 'nodejs-anchor': }
105
88 vcsrepo { "${base_install_dir}/etherpad-lite": 106 vcsrepo { "${base_install_dir}/etherpad-lite":
89 ensure => $ep_ensure, 107 ensure => $ep_ensure,
90 provider => git, 108 provider => git,
@@ -105,7 +123,7 @@ class etherpad_lite (
105 environment => "HOME=${base_log_dir}/${ep_user}", 123 environment => "HOME=${base_log_dir}/${ep_user}",
106 require => [ 124 require => [
107 Vcsrepo["${base_install_dir}/etherpad-lite"], 125 Vcsrepo["${base_install_dir}/etherpad-lite"],
108 Buildsource["${base_install_dir}/nodejs"], 126 Anchor['nodejs-anchor'],
109 ], 127 ],
110 before => File["${base_install_dir}/etherpad-lite/settings.json"], 128 before => File["${base_install_dir}/etherpad-lite/settings.json"],
111 creates => "${base_install_dir}/etherpad-lite/node_modules", 129 creates => "${base_install_dir}/etherpad-lite/node_modules",