From e2fc0433de38c322ce46ad250bc0f0f03e7710c8 Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Thu, 24 Oct 2024 06:43:08 -0400 Subject: add icinga --- scripts/hostclass/postgresql_server | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'scripts/hostclass/postgresql_server') diff --git a/scripts/hostclass/postgresql_server b/scripts/hostclass/postgresql_server index dbb84b4..cbd9c17 100644 --- a/scripts/hostclass/postgresql_server +++ b/scripts/hostclass/postgresql_server @@ -19,7 +19,21 @@ postgres_tls_cert="${postgres_home}/postgres.crt" postgres_tls_key="${postgres_home}/postgres.key" postgres_keytab="${keytab_dir}/postgres.keytab" -pkg install -y postgresql${postgresql_version}-server +postgres_psql(){ + psql \ + --quiet \ + --no-align \ + --echo-all \ + --tuples-only \ + --no-password \ + --username=postgres \ + --dbname=postgres \ + "$@" +} + +pkg install -y \ + postgresql${postgresql_version}-server \ + postgresql${postgresql_version}-contrib # Create ZFS dataset for postgresql data. create_dataset \ @@ -78,7 +92,7 @@ echo 'Restarting postgresql.' service postgresql restart > /dev/null 2>&1 < /dev/null || die 'failed to start postgresql' # Create boxconf admin user. -psql --quiet --no-align --echo-all --tuples-only --no-password --username=postgres --dbname=postgres -c \ +postgres_psql -c \ "DO \$$ BEGIN @@ -87,3 +101,6 @@ BEGIN END IF; END \$$" + +# Load citext extension (required by icingadb) +postgres_psql -c 'create extension if not exists citext;' -- cgit v1.2.3