Minor tweaks to etherpad_lite module.

Set custom pad.js file to mode 0644. Add nginx config for Etherpad-Lite
to sites-available then symlink to that from sites-enabled. Use Ubuntu
packages for Node.js and NPM instead of building from source (Precise
appears to have fairly recent packages that work).

Change-Id: I752a10ea32b462ef0cc8a5a515dd44c9390a4776
This commit is contained in:
Clark Boylan 2012-06-19 17:46:11 +00:00
parent 75d632bf64
commit 6511e79399
4 changed files with 20 additions and 51 deletions

View File

@ -44,35 +44,6 @@ define git_repo (
}
# define to build from source using ./configure && make && make install.
define buildsource(
$dir = $title,
$user = 'root'
) {
exec { "./configure in ${dir}":
command => './configure',
path => "/usr/bin:/bin:/usr/local/bin:${dir}",
user => $user,
cwd => $dir,
} ->
exec { "make in ${dir}":
command => 'make',
path => '/usr/bin:/bin',
user => $user,
cwd => $dir,
} ->
exec { "make install in ${dir}":
command => 'make install',
path => '/usr/bin:/bin',
user => $user,
cwd => $dir,
}
}
# Class to install etherpad lite. Puppet acts a lot like a package manager
# through this class.
#
@ -115,34 +86,18 @@ class etherpad_lite (
mode => 0664,
}
git_repo { 'nodejs_repo':
repo => 'https://github.com/joyent/node.git',
dest => "${base_install_dir}/nodejs",
branch => 'v0.6.16-release',
clone_only => 'true',
require => Package['git']
}
package { ['gzip',
'curl',
'python',
'libssl-dev',
'pkg-config',
'abiword',
'build-essential',]:
'build-essential',
'nodejs',
'npm',]:
ensure => present
}
buildsource { "${base_install_dir}/nodejs":
require => [Package['gzip'],
Package['curl'],
Package['python'],
Package['libssl-dev'],
Package['pkg-config'],
Package['build-essential'],
Git_repo['nodejs_repo']]
}
git_repo { 'etherpad_repo':
repo => 'https://github.com/Pita/etherpad-lite.git',
dest => "${base_install_dir}/etherpad-lite",
@ -158,7 +113,15 @@ class etherpad_lite (
cwd => "${base_install_dir}/etherpad-lite",
environment => "HOME=${base_log_dir}/${ep_user}",
require => [Git_repo['etherpad_repo'],
Buildsource["${base_install_dir}/nodejs"]],
Package['gzip'],
Package['curl'],
Package['python'],
Package['libssl-dev'],
Package['pkg-config'],
Package['build-essential'],
Package['nodejs'],
Package['npm']
],
before => File["${base_install_dir}/etherpad-lite/settings.json"]
}

View File

@ -13,7 +13,7 @@ class etherpad_lite::nginx (
notify => Service['nginx']
}
file { '/etc/nginx/sites-enabled/etherpad-lite':
file { '/etc/nginx/sites-available/etherpad-lite':
ensure => present,
content => template('etherpad_lite/nginx.erb'),
replace => 'true',
@ -22,6 +22,11 @@ class etherpad_lite::nginx (
notify => Service['nginx']
}
file { '/etc/nginx/sites-enabled/etherpad-lite':
ensure => link,
target => '/etc/nginx/sites-available/etherpad-lite'
}
file { '/etc/nginx/ssl':
ensure => directory,
owner => 'root',

View File

@ -35,6 +35,7 @@ class etherpad_lite::site (
source => 'puppet:///modules/etherpad_lite/pad.js',
owner => $etherpad_lite::ep_user,
group => $etherpad_lite::ep_user,
mode => 0644,
require => Class['etherpad_lite']
}

View File

@ -20,7 +20,7 @@ end script
script
cd $EPHOME
exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- /usr/local/bin/node node_modules/ep_etherpad-lite/node/server.js \
exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- node node_modules/ep_etherpad-lite/node/server.js \
>> $EPLOGS/access.log \
2>> $EPLOGS/error.log
end script