Commit Graph

36 Commits

Author SHA1 Message Date
Jeremy Stanley d3a34d0989 Upgrade to latest EtherCalc (0.20200505.0)
We're four years behind on EtherCalc releases, and suddenly hitting
a crash exception which was fixed in a newer release three years
ago. According to the current readme we're running plenty new enough
dependencies, so this should be a drop-in replacement. Of course
we'll make an extra database backup immediately before hand, just to
be safe.

Change-Id: Iec59692fea0a1e31e1bd7b8e03145f7384d9e59b
2020-08-21 12:14:35 -07:00
Colleen Murphy 65eab03783 Use versioncmp function
Without this patch, puppet uses lexicographic ordering to compare the
version string in the operatingsystemrelease fact to the string '14.04',
which works fine on puppet 4 since it is comparing two strings but it is
more correct to use the versioncmp function.

Change-Id: I56d989d22229db3d606e4ac7f788925c216721a0
2018-08-13 17:35:42 +02:00
Colleen Murphy 23a6360c25 Add workaround for ethercalc bug
There is a bug with global npm installs[1] which causes node to be
unable to find the SocialCalc.js module. We can work around it by
symlinking the socialcalc module into the location that node expects to
find it[2].

[1] https://github.com/audreyt/ethercalc/issues/542
[2] https://github.com/audreyt/ethercalc/issues/542#issuecomment-330039410

Change-Id: I6f751c19c772cda74f5a7b601238b4519039d257
2018-08-13 12:00:57 +02:00
Colleen Murphy fe5d375e4a Turn off binary symlink in nodejs module
On Xenial, the nodejs puppet module tries to create a symlink from
/usr/bin/node to /usr/bin/nodejs. Depending on the resource ordering,
this might happen before or after the nodejs package creates its own
/usr/bin/node. If puppet has the chance to make the symlink itself, it
breaks node by creating a broken link cycle. This patch uses the
legacy_debian_symlinks parameter to prevent the puppet module from doing
that. This problem was fixed and the option was deprecated and removed
in later versions of the nodejs puppet module, so we will have to remove
the parameter if we update the nodejs module.

Change-Id: I61e591dbeabe4c043f87b04a7c56c0539120f8a5
2018-08-09 20:56:27 +02:00
Jens Harbott 05b1414b9b Update ethercalc to work with Ubuntu Xenial
- Set up service via systemd instead of upstart.
 - defupalt to using nodejs v6.x because of library issues.
 - upstream nodejs puppet knows how to do legacy symlinks on required
   platforms.

Depends-On: I2355cf58c899bf5f78173b2ed9da26548a9592d0
Depends-On: Ia7966fb9578d0d79f3a7f9480e3a956555737dc8
Change-Id: Ia3f4d3bbacbbe1a42a33a4f934173fb54a582a8e
2018-08-09 20:56:27 +02:00
Clark Boylan 31e44bbcb0 Allow multiple places to install curl
Curl is an important package that we end up needing in a few places. To
avoid puppet unique name conflicts with the package "curl" only define
the curl package resource if it isn't already defined.

This allows us to define it in multiple places that may or may not
overlap depending on how hosts are constructed.

Change-Id: Icd0c652ff2f522ce2ea9086965f53e1a03f0d4fd
2017-08-24 13:46:04 -07:00
Clark Boylan 4034168e71 Don't use npm list --parseable
Turns out we lose version info with --parseable (so not sure in what
world this is parseable output) so stop using the --parseable flag. This
corrects behavior where we reinstall ethercalc every puppet run which
can upgrade unpinned dep libs in ways that break them on older node (we
are using the ethercalc prescribed node but its a little old).

Change-Id: Ib9aebecf3a0c36c50e5069b1a871886e4ddb1a42
2017-02-13 17:44:43 -08:00
Clark Boylan 521672bc35 Convert from etherpad to ethercalc
This begins the conversion process. We keep the bulk of the nodejs and
apache configuration. Remove mysql and replace with redis and so on.

This is not a complete conversion, future work should include
authenticated redis configuration and systemd support. However, this
should be able to get the service running with a basic set of
features and functionality.

Change-Id: Id10247211d9643e81bb1b6e8fb67377ba6de873a
2017-01-20 12:44:41 -08:00
Clark Boylan cbe2ba8724 Use nodejs class to install nodejs
This is a backward incompatible change. Sorry. But now we can rely on a
much better portable system for installing nodejs using the nodesource
packages instaed of building it ourselves. This is important because the
system packages on some distros (like Ubuntu Trusty) can no longer talk
to npm resulting in a failed etherpad install.

You can continue to use the system packages if you desire using the same
old config. But you now need to provide the nodejs class'
repo_url_suffix as your nodejs_version parameter should you not want to
use the system packages.

Note that transitioning from system to the nodesource packaged nodejs is
not currently supported by this change. Basically this means that if you
have an existing system setup which uses old npm you may want to just
redeploy your server from scratch using the nodesource packages to move
forward.

Change-Id: Ia686f9eba15e0a3dfa81d08aecc212853b3f7189
2016-11-15 14:04:18 -08:00
Clark Boylan 411f392c14 Put /usr/local/bin at front of path
If things get installed by something other than the system package
manager they often end up in /usr/local/bin and they often shadow things
that the system package manager may have installed. By putting this at
the end of the path we don't get the benefit of that shadowing and
instead get whatever the system package manager installed.

This is particularly unhelpful when attempting to use an npm updated by
npm itself which ends up in the local dir.

Change-Id: Ifb58c98162f0064a2ae70868921eea507306ad7e
2016-11-14 18:46:21 -08:00
Clark Boylan 88d20d9a0f Install curl as dep for etherpad dep install
Etherpads dependency install process requires curl, ensure that it is
installed before we need it.

Change-Id: I711e43f0dd9c8287c26e2861498eb3ebb191e878
2016-11-14 18:46:07 -08:00
Andrey Nikitin cd6889a359 Order of the classes parameters is refactored
Order and intendation of those parameters are changed
to follow Puppet Style Guide recommendation [0].
Moreover, it will allow to an user to find much faster
a variable in a list of variables.

[0]. https://docs.puppetlabs.com/guides/style_guide.html

Change-Id: If012896a95088ae836d5dfa35aa3cad553aee516
2016-03-21 12:07:49 +03:00
Samuel de Medeiros Queiroz 957ecb6cef Ensure abiword package is always present
Change I9831526581a5fc1f2014c9985637664c79b937bf
moved the required packages list statement into a
conditional block, making it to be ensured only
in the case nodejs_version was set to 'system'.

This was causing the abiword library to not be
installed and then etherpad.o.o was appending the
following error message to new pads:

  Error: Abiword does not exist at this path,
  check your settings file -- To suppress these
  warning messages change suppressErrorsInPadText
  to true in your settings.json

This patch makes the abiword library to always be
installed by moving it out of that conditional
statement.

Change-Id: I50f55e4408d850b2bf449b121b9014d511518481
2015-09-16 12:19:08 -03:00
Clark Boylan 6a254faec5 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
2015-08-20 15:17:04 +00:00
K Jonathan Harker ac6b7c3ead Add parameter to tune vcsrepo ensure for eplite
If the vcsrepo is set to 'ensure => present' then local changes will
prevent the repo from updating, but if we 'ensure => latest' then local
changes will be overwritten when updating to the latest revision.

Change-Id: Ie560a00e70e428b46ac431975caa74d7d05fcad4
2015-03-09 12:03:49 -07:00
Ricardo Carrillo Cruz 2a4a032c0d Change /sbin/nologin to /usr/sbin/nologin for Ubuntu
This change fixes Puppet on Ubuntu/Debian platforms, as /sbin/nologin
does not exist

Change-Id: Ia91ef6a6fcba6cbf323c7aece895181b3f5470a7
2015-01-30 14:33:43 +00:00
Clark Boylan 3f3cfa02e0 Upgrade the version of node for etherpad-lite.
* modules/etherpad_lite/manifests/init.pp: Bump node to 0.10.21.

Change-Id: I29ddc3800482ed5da64ccb76fdf39ad1e91bc228
2013-10-18 17:16:45 -07:00
Clark Boylan 88bb5cd21c Update etherpad and etherpad puppet manifests.
* manifests/site.pp: Pass new mysql DB variables to
openstack::etherpad*.

* modules/etherpad_lite/manifests/apache.pp: Fix broken /etc/ssl/certs
permissions (0700 -> 0755).

* modules/etherpad_lite/manifests/init.pp: Update default nodejs and
etherpad versions. Remove ep_headings plugin install. New plugin define
should be used for this instead. Stop making the etherpad-lite ref to
checkout optional (defaults to develop). Note these changes are probably
not going to be backward compat.

* modules/etherpad_lite/manifests/plugin.pp: Define to install etherpad
lite plugins.

* modules/etherpad_lite/manifests/site.pp: Simplify DB support and
remove support for the dirty DB type.

* modules/etherpad_lite/templates/etherpad-lite_settings.json.erb: Bring
settings erb up to par with latest template.

* modules/etherpad_lite/templates/etherpadlite.vhost.erb: Update rewrite
rules for new etherpad. Instead of allowing nice pad urls rooted at /
redirect these url to /p/padname. Etherpad does not deal well with a
change in root path as /p/ is hardcoded in many places.

* modules/openstack_project/manifests/etherpad.pp
* modules/openstack_project/manifests/etherpad_dev.pp:
Update to use new etherpad module setup. MySQL DBs are now externally
managed, pass in needed connection info.

* modules/mysql_backup/manifests/backup_remote.pp: New define to backup
remote DB servers.

* modules/mysql_backup/templates/my.cnf.erb: Template for a my.cnf to be
used by the cron in backup_remote.pp. Allows for easy connectivity from
server using MySQL DB as root.

Change-Id: I1250297674b91e81d59cd28c07c52e09967ca548
2013-10-09 16:53:06 -07:00
Sean Dague 3c814faa76 add ep_fintest, needed by ep_headings to etherpad
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.

on my environment I also had the installation of ep_fintest, because
plugins didn't seem to work until I did this. Testing that.

Change-Id: Ia1ee0fd7b51e88f639de5350f124f1a95405cabf
Reviewed-on: https://review.openstack.org/26422
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2013-04-09 17:19:51 +00:00
Sean Dague 6d69f50d5c 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 <mordred@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-04-08 19:00:46 +00:00
Clark Boylan 33366f58a8 Use new etherpad-lite upstream.
etherpad-lite moved their upstream git repo to
https://github.com/ether/etherpad-lite.git. Update the vcsrepo source
for etherpad-lite when giving vcsrepo a specific version of
etherpad-lite. Do not update the source for the versionless vcsrepo
resource.

This allows us to leave etherpad.o.o alone while we install
etherpad-dev.o.o. Once etherpad-dev.o.o is working and we have tested an
upgrade to latest eplite and new node we can flip etherpad.o.o to the
new source.

Change-Id: I7cb9aaa5211f57c84698887500f519f92c514e91
Reviewed-on: https://review.openstack.org/17566
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-12-06 18:13:26 +00:00
Paul Belanger 4402b55637 Additional puppet-lint formatting
Change-Id: I6e5fa77a301eec30cff8e16bad33a91bfd95b13f
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/17176
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2012-11-30 20:56:32 +00:00
Matthew Wagoner 819586dc32 Clean up of minor puppet-lint warnings.
Mostly documentation and parameterised class parameter complaints.

Change-Id: I5b3ffa4ad3f707f385165c2d86c891c6bd4c1ae0
Reviewed-on: https://review.openstack.org/16901
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-26 20:55:57 +00:00
Matthew Wagoner 1ce4b91543 Cleanup etherpad_lite manifest lint errors.
Also, seperate out the buildsource defined resource from init.pp

Change-Id: I9fe46ad31943f667ebe8bb6b01a2007e0b3cf022
Reviewed-on: https://review.openstack.org/15061
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-17 01:30:36 +00:00
Clark Boylan 9641a55f1c Fix eplite node.js install problems.
Two problems installing node.js for etherpad lite on a new host:
1. Install may be attempted before repository is properly cloned.
2. Installing node from source may take longer than the default exec
timeout.

Fix this by adding more order requirements and increase the exec timeout
when running make on node.js.

Change-Id: I74c225ee725e6e67b54dbf8ba7795d28e82c66e3
Reviewed-on: https://review.openstack.org/16013
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-11-13 22:07:22 +00:00
Clark Boylan 2ab81a00e4 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 <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-11-02 06:59:11 +00:00
Monty Taylor 3e769e56a3 Align all web server usage on apache module.
Change-Id: Idd712a8ee5ec81c6b88b7d3e2270dce4da254927
Reviewed-on: https://review.openstack.org/10838
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-12 17:03:46 +00:00
Monty Taylor 8e736d0403 Changed git ref for node.js to use release tag.
Change-Id: I157623dbfc2ef4ace6ced8d27e03afd0f5f7b153
Reviewed-on: https://review.openstack.org/11208
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-11 16:49:15 +00:00
Monty Taylor 9aa9e79029 Remove unneeded origin/ prefix.
Change-Id: If38227a8f2bf5890f59bc4050f71d400447771b7
Reviewed-on: https://review.openstack.org/10957
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-07 13:44:56 +00:00
Monty Taylor 8e6332a9a1 Replace manual git work with vcsrepo module.
Change-Id: Ia0f3acd50aab07cc83d13cd12c8f7fc67f1c697d
Reviewed-on: https://review.openstack.org/10832
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2012-08-07 07:09:43 +00:00
Monty Taylor 60146e4fc4 First pass at parameterizing secret infos.
Change-Id: Iee56a7e65be51ebf19a61eefd60cc93de6a764bf
2012-07-20 14:40:42 -07:00
Clark Boylan 2437144192 Go back to using self compiled node.js.
The version of node.js packaged by ubuntu does not seem to play nice
with require-kernel and etherpad-lite. Go back to compiling version
0.6.16 of node.js which is tested and appears to be working.

Change-Id: Ib9bda5d7acbda06561398a0c715b28e46edb531d
2012-06-21 17:52:43 +00:00
Clark Boylan 6511e79399 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
2012-06-19 18:36:08 +00:00
Clark Boylan 9653ee965a Fix etherpad lite's use of git.
Before this commit etherpad lite would run a git pull or clone
every time puppet was run. Make that behavior toggleable. Now
etherpad lite will only clone and checkout the branch specified.
This makes puppet less chatty to upstream.

Also, fix a quoting issue in etherpad lite's mysql manifest. The
eplite user's password was being reset each time puppet ran due to
having single quotes around backticks in the unless clause.

Change-Id: I74418ebaba82902906d04f18386de6f6bd6259bb
2012-06-06 20:31:18 +00:00
Clark Boylan 022e155ec3 Update eplite module for new version of eplite.
Etherpad lite has changed their source tree slightly. This has
required a few updates to the etherpad lite puppet module. The
custom pad.js needs to go in a different directory and the upstart
conf file needs a couple updated paths.

In addition to the fixes a couple things have been cleaned up. Now
define an etherpadlite.openstack.org node in site.pp and copy SSL
certs from /root/secret-files.

Change-Id: I312b419aa98212b6db68232c672bc4d75f23777f
2012-05-31 23:16:57 +00:00
Clark Boylan 18175e4c18 Puppet Module to install etherpad-lite.
Part of the work necessary for bug #995248

Puppet module to do a basic install of etherpad-lite. Currently
installs etherpad-lite and node.js. Configures etherpad-lite to use
mysql for its DB backend and sets up nginx to reverse proxy
etherpad-lite.

Change-Id: I3ee1ce4594fcf2a27b520a3ad7a024318f69111a
2012-05-10 20:33:51 +00:00