From 5e1032519189f3b6fa793cec81833a781a91d8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 18 Jun 2023 20:35:48 +0200 Subject: Rewrote almost everything. --- manifests/database.pp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'manifests/database.pp') 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, -- cgit v1.2.3