From 3cbe0a840918fadba1e5ffb41a3a3e9dd5a35b66 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 25 Oct 2012 16:09:13 -0700 Subject: [PATCH] Add etherpad-dev node and host class. We now host etherpad.openstack.org. To properly test upgrades and things add a proper etherpad-dev host to puppet. Currently the configuration is set to mimic that which is on etherpad.o.o. Once the -dev host is up and running it will be used to test upgrades to more modern etherpad lite and node.js version. Also at some point we will probably want to use the puppetlabs-mysql module to manage the mysql instances for etherpad. This dev host makes that easier. Change-Id: I63500026a1a38d7c4dd5b00cc869586eb2483497 Reviewed-on: https://review.openstack.org/14861 Reviewed-by: Jeremy Stanley Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins --- manifests/site.pp | 7 ++++ modules/etherpad_lite/manifests/init.pp | 37 ++++++++++++------ .../manifests/etherpad_dev.pp | 38 +++++++++++++++++++ 3 files changed, 71 insertions(+), 11 deletions(-) create mode 100644 modules/openstack_project/manifests/etherpad_dev.pp diff --git a/manifests/site.pp b/manifests/site.pp index 7ddd850c3f..f972f3199b 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -162,6 +162,13 @@ node 'etherpad.openstack.org' { } } +node 'etherpad-dev.openstack.org' { + class { 'openstack_project::etherpad_dev': + database_password => hiera('etherpad-dev_db_password'), + sysadmins => hiera('sysadmins'), + } +} + node 'wiki.openstack.org' { class { 'openstack_project::wiki': mysql_root_password => hiera('wiki_db_password'), diff --git a/modules/etherpad_lite/manifests/init.pp b/modules/etherpad_lite/manifests/init.pp index 1a6da2cde4..df44cf5233 100644 --- a/modules/etherpad_lite/manifests/init.pp +++ b/modules/etherpad_lite/manifests/init.pp @@ -45,7 +45,9 @@ define buildsource( class etherpad_lite ( $ep_user = 'eplite', $base_log_dir = '/var/log', - $base_install_dir = '/opt/etherpad-lite' + $base_install_dir = '/opt/etherpad-lite', + $nodejs_version = 'v0.6.16', + $eplite_version = '', ) { user { $ep_user: @@ -69,11 +71,11 @@ class etherpad_lite ( } vcsrepo { "${base_install_dir}/nodejs": - ensure => present, + ensure => present, provider => git, - source => 'https://github.com/joyent/node.git', - revision => 'v0.6.16', - require => Package['git'] + source => 'https://github.com/joyent/node.git', + revision => $nodejs_version, + require => Package['git'] } package { ['gzip', @@ -101,12 +103,25 @@ class etherpad_lite ( Vcsrepo["${base_install_dir}/nodejs"]] } - vcsrepo { "${base_install_dir}/etherpad-lite": - ensure => present, - provider => git, - source => "https://github.com/Pita/etherpad-lite.git", - owner => $ep_user, - require => Package['git'], + # Allow existing install to exist without modifying its git repo. + # But give the option to specify versions for new installs. + if $eplite_version != '' { + vcsrepo { "${base_install_dir}/etherpad-lite": + ensure => present, + provider => git, + source => 'https://github.com/Pita/etherpad-lite.git', + owner => $ep_user, + revision => $eplite_version, + require => Package['git'], + } + } else { + vcsrepo { "${base_install_dir}/etherpad-lite": + ensure => present, + provider => git, + source => 'https://github.com/Pita/etherpad-lite.git', + owner => $ep_user, + require => Package['git'], + } } exec { 'install_etherpad_dependencies': diff --git a/modules/openstack_project/manifests/etherpad_dev.pp b/modules/openstack_project/manifests/etherpad_dev.pp new file mode 100644 index 0000000000..07199d2584 --- /dev/null +++ b/modules/openstack_project/manifests/etherpad_dev.pp @@ -0,0 +1,38 @@ +class openstack_project::etherpad_dev ( + $database_password, + $sysadmins = [] +) { + class { 'openstack_project::server': + iptables_public_tcp_ports => [22, 80, 443], + sysadmins => $sysadmins + } + + class { 'etherpad_lite': + # Use the version running on the prod server. + eplite_version => '4195e11a41c5992bc555cef71246800bceaf1915', + # Use the version running on the prod server. + nodejs_version => 'v0.6.16', + # Once dev install is working replace the above parameters with + # the following to test automated upgrade by puppet. + # eplite_version => '1.1.4', + # nodejs_version => 'v0.8.14', + } + + include etherpad_lite::backup + + class { 'etherpad_lite::apache': + ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem', + ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key', + ssl_chain_file => '', + } + + class { 'etherpad_lite::site': + database_password => $database_password, + } + + class { 'etherpad_lite::mysql': + database_password => $database_password, + } +} + +# vim:sw=2:ts=2:expandtab:textwidth=79