aboutsummaryrefslogtreecommitdiff
path: root/scripts/hostclass/postgresql_server
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/hostclass/postgresql_server')
-rw-r--r--scripts/hostclass/postgresql_server5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/hostclass/postgresql_server b/scripts/hostclass/postgresql_server
index cbd9c17..b3e8804 100644
--- a/scripts/hostclass/postgresql_server
+++ b/scripts/hostclass/postgresql_server
@@ -104,3 +104,8 @@ END
# Load citext extension (required by icingadb)
postgres_psql -c 'create extension if not exists citext;'
+
+# Create icinga user.
+postgres_psql <<EOF
+SELECT 'CREATE ROLE "${icinga_username}" WITH LOGIN' WHERE NOT EXISTS (SELECT FROM pg_roles WHERE rolname = '${icinga_username}')\\gexec
+EOF