elm-city-craftworks/practicing-ruby-cookbook — pull request #21 by mlafeldt (2014-02-13 15:28:07+00:00)
Title: Allow to use remote PostgreSQL database

With this small change, we can use an external PostgreSQL database.

For example, I managed to connect to an external [RDS instance in AWS](http://aws.amazon.com/rds/postgresql/) only by overriding `node["practicingruby"]["database"]["host"]`. The remaining bits are handled by Chef/Capistrano/Rails as usual.

```
$ psql -l --host=mathias-postgres-test.xxx.eu-west-1.rds.amazonaws.com --username=postgres
Password for user postgres:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
----------------------------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
practicing-ruby-production | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
rdsadmin | rdsadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | rdsadmin=CTc/rdsadmin
template0 | rdsadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/rdsadmin +
| | | | | rdsadmin=CTc/rdsadmin
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
```