diff options
author | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-24 06:43:08 -0400 |
---|---|---|
committer | Cullum Smith <cullum@sacredheartsc.com> | 2024-10-24 06:43:08 -0400 |
commit | e2fc0433de38c322ce46ad250bc0f0f03e7710c8 (patch) | |
tree | f04f079ed745f0c0350af93adf6491bbfec1cd13 /scripts/hostclass/postgresql_server | |
parent | 393adb9a95913e1658afe3243e4a0498dced9090 (diff) | |
download | infrastructure-e2fc0433de38c322ce46ad250bc0f0f03e7710c8.tar.gz |
add icinga
Diffstat (limited to 'scripts/hostclass/postgresql_server')
-rw-r--r-- | scripts/hostclass/postgresql_server | 21 |
1 files changed, 19 insertions, 2 deletions
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;' |