diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-18 20:35:48 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-20 00:26:09 +0200 |
commit | 5e1032519189f3b6fa793cec81833a781a91d8f2 (patch) | |
tree | 51a5ba59974e61f7a56128afcb324d49c9f8b7c8 /manifests/database.pp | |
parent | Initial add. (diff) | |
download | concourse-5e1032519189f3b6fa793cec81833a781a91d8f2.tar.gz concourse-5e1032519189f3b6fa793cec81833a781a91d8f2.tar.xz |
Rewrote almost everything.
Diffstat (limited to 'manifests/database.pp')
-rw-r--r-- | manifests/database.pp | 25 |
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, |