ansible/ansible — pull request #5467 by jinnko (2013-12-31 18:27:01+00:00)
Title: postgresql_user module: Gracefully handle ALTER ROLE on read-only postgres servers.

Re-request of https://github.com/ansible/ansible/pull/5202.

Currently this module will raise an unhandled exception if there's any type of error applying the ALTER ROLE. Standby servers are in a read-only state, therefore they will return an error when trying to ALTER ROLE.

This patch catches the exception and reports the error. It is then possible to allow the ansible run to continue if ignore_errors=True in the task.

This commit also fixes a bug that would have triggered an exception when user = PUBLIC and password is not None.