diff options
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;' |