Postgresql Facts

postgresql.PostgresqlDatabases

host.get_fact(PostgresqlDatabases, postgresql_user=None, postgresql_password=None, postgresql_host=None, postgresql_port=None)

Returns a dict of PostgreSQL databases and metadata:

{
    "pyinfra_stuff": {
        "encoding": "UTF8",
        "collate": "en_US.UTF-8",
        "ctype": "en_US.UTF-8",
        ...
    },
}

postgresql.PostgresqlRoles

host.get_fact(PostgresqlRoles, postgresql_user=None, postgresql_password=None, postgresql_host=None, postgresql_port=None)

Returns a dict of PostgreSQL roles and data:

{
    'pyinfra': {
        'super': true,
        'createrole': false,
        'createdb': false,
        ...
    },
}