From 155c93f739e21bac64558346cb653a52d5b2d435 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 16 Oct 2020 20:10:55 +0200 Subject: [PATCH] bundles/powerdns: fix schema import for pgsql --- bundles/powerdns/items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/powerdns/items.py b/bundles/powerdns/items.py index fe8bd8d..3f903a8 100644 --- a/bundles/powerdns/items.py +++ b/bundles/powerdns/items.py @@ -141,7 +141,7 @@ if node.metadata['powerdns'].get('features', {}).get('pgsql', False): actions = { 'powerdns_load_pgsql_schema': { - 'command': 'sudo -u postgres psql -d powerdns < /etc/powerdns/schema.pgsql.sql', + 'command': 'PGPASSWORD={pw} psql -h 127.0.0.1 -d powerdns -U powerdns -w < /etc/powerdns/schema.pgsql.sql'.format(pw=node.metadata['postgresql']['users']['powerdns']['password']), 'unless': 'sudo -u postgres psql -d powerdns -c "\dt" | grep domains 2>&1 >/dev/null', 'needs': { 'bundle:postgresql',