Use psycopg2's string handling to escape password string

This allows the password to contain single quotes and should make it safe to
use randomly generated passwords (provided passwords can be represented in the
connection encoding).
Prevent premature substitution of variables into tasks

As documented in #2623, early variable substitution causes when_
tests to fail and possibly other side effects.

I can see the reason for this early substitution, likely introduced
in 1dfe60a6, to allow many playbook parameters to be templated.
This is a valid goal, but the recursive nature of the utils.template
function means that it goes too far.

At this point removing tasks from the list of parameters to be
substituted seems sufficient to make my tests pass. It may be the
case that other parameters should be excluded, but I suspect not.

Adding a test case. I would prefer to analyse not just the aggregate
statistics but also whether the results are as expected - I can't
see an easy way to do that with the available callbacks at present.
Merge pull request #2623 from willthames/when_set_bug

Prevent premature variable substitution in tasks
Added catch-all exception for stats collection.
Also template handlers only at the end.
Explain conditionals as applied to roles.  I could also explain with_items but the scope questions are complex
here, and it is better to include such loops inside the imported tasks.
Merge pull request #2667 from jsmartin/devel

Added catch-all exception for riak stats collection.
Add link to prior docs version.
Make less template calls on playbook objects.
Errors in documentation.
Merge pull request #2670 from jsmartin/devel

Errors in Riak documentation.
Merge pull request #2605 from b6d/postgresql_user-quote-pwd

Use psycopg2's string handling to escape password string
user module: return public SSH key

Return public SSH key if the user module is called with generate_ssh_key=yes.
Since "user" doesn't overwrite files, this also allows querying of existing
public keys.

Used in playbooks together with the "register" keyword, the returned key can be
passed to the "authorized_key" module allowing easy setup of SSH public key
authentication between remote hosts.
Add module postgresql_privs

This Module allows to manage privileges on PostgreSQL database objects
(currently: tables, sequences, functions, databases, schemas, languages and
tablespaces) as well as group role memberships.

It is basically a wrapper around most of the functionality of PostgreSQL's
GRANT and REVOKE statements with additional detection of changes and support
for dry-runs (check-mode).

postgresql_privs should work with PostgreSQL 8.4 and above. Python Module
psycopg2 is required on the remote host.
Merge pull request #2673 from b6d/user-module-extension

user module: return public SSH key
Merge pull request #2676 from b6d/postgresql_privs-module-proposal2

Proposal for a module to manage PostgreSQL privileges (2)
Working on the FAQ.