travis-ci/travis-cookbooks — pull request #221 by gildegoma (2013-09-20 22:58:31+00:00)
Title: Revamp 'postgresql': Add support of PostgreSQL 9.2 and 9.3, and also PostGIS 2.1

@joshk: This should correspond to the features we discussed this week. For your tests, please don't forget to update the [run_list](https://github.com/travis-ci/travis-images/blob/master/templates/worker.standard.yml#L79) (`postgresql::default` replaces `postgresql::client` and `postgresql::server_on_ramfs`).

@michaelklishin: I inspected git history and travis current production, and I hope I haven't missed any custom features (e.g. RAMFS, `postgresql.conf` performance tuning, ...)

**Summary**

- Use PDPG apt repository
- Install multiple instances (9.1, 9.2 and 9.3)
- Preinstall PostGIS 2.1 for all instances
- Only supports Ubuntu 12.04LTS (all outdated and unused recipes
original Opscode cookbook have been removed. e.g. Redhat/RPM flavors)
- Customize /etc/init.d/postgresql to be backward compatible (default
postgresql version is used if not specified), and to prevent to start
more than one instance at the same time
- Database copy to RAMFS storage is now explicitly handled by chef provision
(instead of idempotent copy in /etc/init.d/postgresql script)
- CI-Specific tunings are still there (and parametrized, if not already)
see original commits 29f200f5bc and f34cf19a68.
- Clean and fix handling of /etc/sysctl.conf and /etc/sysctl.d/...
- Refactor 'sysctl' cookbook to dynamically compute System V shared
memory depending on 'postgresql' configuration (`max_connection`)
- Add a parameter in 'ramfs' cookbook to adjust disk size (default is
still 512M)
- Set max_connections = 255 as default (No more needed to override this
attribute in [travis-images standard template](https://github.com/travis-ci/travis-images/blob/master/templates/worker.standard.yml#L13))

The resulting cookbook is simply organized (less recipes) and strictly focused on Continuation Integration context.
The relashionship with very old forked version (0.11) of original Opscode cookook doesn't make sense any more. For these reasons I bump this cookbook to version 2.0.0, in order to clearly mark this step, but not
to express maturity level. Feel free to set the version you prefer.

About #165: this cookbook could easily be extracted, but I didn't make it so far. If we do it in the future, I would propose to rename it as `postgresql-ci` (or something similar to clearly distinguish from community.opscode.com/cookbooks/postgresql).