aboutsummaryrefslogtreecommitdiff
path: root/manifests/database.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/database.pp')
-rw-r--r--manifests/database.pp25
1 files changed, 20 insertions, 5 deletions
diff --git a/manifests/database.pp b/manifests/database.pp
index d921cc9..bc5046a 100644
--- a/manifests/database.pp
+++ b/manifests/database.pp
@@ -1,8 +1,23 @@
-class concourse::database (
- String $username = lookup("concourse::${cluster}::postgres_user"),,
- Variant[String, Sensitive[String]] $password = lookup("concourse::${cluster}::postgres_user"),
- String $db_name = "atc-${cluster}",
- String $cluster = $concourse::default_cluster,
+# @summary Manage the database posts for concourse.
+#
+# A single database is needed for each cluster.
+# This resource sets up up postgres database for a given cluster.
+#
+# @param username
+# Username used to connect to the postgres instance
+# Cluster specific.
+# @param password
+# Password used to connect to the postgres instance.
+# Cluster specific.
+# @param db_name
+# Name of the database to use for this cluster.
+# @param cluster
+# Name of the cluster in question. Changes all other values's defaults.
+define concourse::database (
+ String $cluster = $concourse::default_cluster,
+ String $username = $concourse::configured_clusters[$cluster]['postgres_user'],
+ Variant[String, Sensitive[String]] $password = $concourse::configured_clusters[$cluster]['postgres_password'],
+ String $db_name = $concourse::configured_clusters[$cluster]['db_name'],
) {
postgresql::server::db { $db_name:
user => $username,