hw-cookbooks/postgresql — pull request #198 by rhass-r7 (2014-10-10 22:23:15+00:00)
Title: Fix SSL for PostgreSQL versions < 9.2

Abstract of Change
--------------------------
Prior to version 9.2 of PostgreSQL there was not a ssl_key_file or ssl_cert_file argument. This fixes support for these older version to ensure certificates are used properly.

Validation
-------------
This is something we will need to discuss... I was able to validate: server-ubuntu-1404, server-ubuntu-1204, and server-centos-70. However, `kitchen test` failed for 10.04 for unrelated reasons, so I just converged some by doing kitchen converge on the ones I listed.

Given this information, I was not comfortable with including the following patch in the PR as I am not confident it will work on all Linux flavors, nevertheless it is required to validate the feature on Ubuntu/Debian. I did noticed there is a 'feature/test-kitchen-refresh' branch, I am curious to find out if some of the issues have been resolved here.

- [ ] Patch your .kitchen.yml with the following patch:
``` diff
diff --git a/.kitchen.yml b/.kitchen.yml
index 394fbf3..5750b03 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -76,6 +76,9 @@ suites:
postgresql:
password:
postgres: "iloverandompasswordsbutthiswilldo"
+ config:
+ ssl_key_file: "/etc/ssl/private/ssl-cert-snakeoil.key"
+ ssl_cert_file: "/etc/ssl/certs/ssl-cert-snakeoil.pem"

- name: apt-pgdg-server
run_list:
```
- [ ] Run kitchen converge ^server (this may fail on some platforms with unrelated failing tests)
- [ ] Instances with Postgresql < 9.2 should have a symlink to the server.crt and server.key files
- [ ] Instances with Postgresql >= 9.2 should havethe ssl_cert_file and ssl_key_file options in the postgresql.conf file.

Questions
-------------
- How and where do I write tests for this patch? Minitest? ChefSpec? ServerSpec?
- Should we add a separate test kitchen suite for this specific flag, or is doing so overkill?