Postgresql

postgresql_databases

host.fact.postgresql_databases(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_roles

host.fact.postgresql_roles(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,
    ...
},
...