From 6d69f50d5cbe9a0e89249bb627a525dbc4c17f93 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 8 Apr 2013 11:20:16 -0400 Subject: [PATCH] add ep_headings option to etherpad install Make it possible to optionally install ep_headings on an etherpad environment. This makes it easy to enable this on some environments, but not all. Default to 'false', but set 'true' for etherpad_dev. With summit coming up, it would be nice to have ep_headings in the etherpads, makes them a lot easier to read. fix puppet lint issue with all the equals signs not lining up. Change-Id: I8cfa12480aed0b351012161c2cdbc406c0f52e7a Reviewed-on: https://review.openstack.org/26380 Reviewed-by: Monty Taylor Reviewed-by: Paul Belanger Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins --- manifests/init.pp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7c4d324..4c97bf8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -16,9 +16,14 @@ class etherpad_lite ( $base_log_dir = '/var/log', $base_install_dir = '/opt/etherpad-lite', $nodejs_version = 'v0.6.16', - $eplite_version = '' + $eplite_version = '', + $ep_headings = false ) { + # where the modules are, needed to easily install modules later + $modules_dir = "${base_install_dir}/etherpad-lite/node_modules" + $path = "/usr/bin:/bin:/usr/local/bin:${base_install_dir}/etherpad-lite" + user { $ep_user: shell => '/sbin/nologin', home => "${base_log_dir}/${ep_user}", @@ -103,8 +108,7 @@ class etherpad_lite ( exec { 'install_etherpad_dependencies': command => './bin/installDeps.sh', - path => - "/usr/bin:/bin:/usr/local/bin:${base_install_dir}/etherpad-lite", + path => $path, user => $ep_user, cwd => "${base_install_dir}/etherpad-lite", environment => "HOME=${base_log_dir}/${ep_user}", @@ -116,6 +120,16 @@ class etherpad_lite ( creates => "${base_install_dir}/etherpad-lite/node_modules", } + if $ep_headings == true { + # install the headings plugin + exec {'npm install ep_headings': + cwd => $modules_dir, + path => $path, + creates => "${modules_dir}/ep_headings", + require => Exec['install_etherpad_dependencies'] + } + } + file { '/etc/init/etherpad-lite.conf': ensure => present, content => template('etherpad_lite/upstart.erb'),