When more than one postgres instance has been deployed the slave node(s) fail to setup the nagios user when in a relation with nrpe-external-master:
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed Traceback (most recent call last):
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed File "/var/lib/juju/agents/unit-push-gateway-pg-1/charm/hooks/nrpe-external-master-relation-changed", line 2636, in <module>
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed hooks.execute(sys.argv)
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed File "/var/lib/juju/agents/unit-push-gateway-pg-1/charm/hooks/charmhelpers/core/hookenv.py", line 490, in execute
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed self._hooks[hook_name]()
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed File "/var/lib/juju/agents/unit-push-gateway-pg-1/charm/hooks/nrpe-external-master-relation-changed", line 2460, in update_nrpe_checks
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed nagios_password = create_user('nagios')
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed File "/var/lib/juju/agents/unit-push-gateway-pg-1/charm/hooks/nrpe-external-master-relation-changed", line 1445, in create_user
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed run_sql_as_postgres(sql, AsIs(quote_identifier(user)), password)
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed File "/var/lib/juju/agents/unit-push-gateway-pg-1/charm/hooks/nrpe-external-master-relation-changed", line 920, in run_sql_as_postgres
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed cur.execute(sql, parameters)
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed psycopg2.InternalError: cannot execute ALTER ROLE in a read-only transaction
2015-01-12 22:29:22 INFO nrpe-external-master-relation-changed