bundlewrap/bundles/postgresql/items.py
mwiegand 9152574276 wip
2021-07-08 00:32:32 +02:00

35 lines
781 B
Python

from bundlewrap.utils.dicts import merge_dict
directories = {
'/var/lib/postgresql': {
'owner': 'postgres',
'group': 'postgres',
'needs': [
'zfs_dataset:tank/postgresql',
],
'needed_by': [
'svc_systemd:postgresql',
],
}
}
svc_systemd['postgresql'] = {
'needs': [
'pkg_apt:postgresql',
],
}
for user, config in node.metadata.get('postgresql/roles').items():
postgres_roles[user] = merge_dict(config, {
'needs': [
'svc_systemd:postgresql',
],
})
for database, config in node.metadata.get('postgresql/databases').items():
postgres_dbs[database] = merge_dict(config, {
'needs': [
'svc_systemd:postgresql',
],
})