diff --git a/bundles/postgresql/items.py b/bundles/postgresql/items.py new file mode 100644 index 0000000..afaa413 --- /dev/null +++ b/bundles/postgresql/items.py @@ -0,0 +1,15 @@ +postgres_roles = {} +postgres_db = {} + +for user, config in node.metadata['postgresql']['users'].items(): + postgres_roles[user] = { + 'password': config['password'], + } + +for database, config in node.metadata['postgresql']['databases'].items(): + postgres_db[database] = { + 'owner': config['owner'], + 'needs': { + 'postgres_role:{}'.format(config['owner']), + }, + }