Automatically set proper pg_host

For a setup with multiple release nodes database.yml should contain the IP of the database server (not string 'localhost').
Good catch here.

I agree this should be updated. So were you thinking this:

    set :pg_host, -> do
      if release_roles(:all).count == 1 && release_roles(:all).first == primary(:db)
        'localhost'
      else
        primary(:db).hostname
      end
    end

btw. role objects have `==` equality defined.