From 4da792f5224cb51a01a05bf97e78136ec143bd60 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 4 Apr 2020 17:53:59 +0200 Subject: [PATCH] bundles/postgresql: add bundle --- bundles/postgresql/items.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bundles/postgresql/items.py 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']), + }, + }