From 99b8524c16cc99ceeaf1ebf588f2fc0f2c0fbe0a Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Sat, 12 Oct 2024 08:14:59 -0400 Subject: add a bunch of hostclasses --- lib/60-postgres | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/60-postgres (limited to 'lib/60-postgres') diff --git a/lib/60-postgres b/lib/60-postgres new file mode 100644 index 0000000..af37c27 --- /dev/null +++ b/lib/60-postgres @@ -0,0 +1,24 @@ +#!/bin/sh + +postgres_run(){ + PGSSLMODE=require PGPASSWORD="$boxconf_password" psql \ + --no-align \ + --echo-all \ + --tuples-only \ + --username="$boxconf_username" \ + -v ON_ERROR_STOP=1 \ + "$@" +} +postgres_create_role(){ + # $1 = postgres_host, $2 = username + cat <