From e54c695ae0d5e90ece866b489fe7bfbbbb5af0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 20 Jun 2023 22:44:52 +0200 Subject: fixes --- manifests/conf.pp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'manifests/conf.pp') diff --git a/manifests/conf.pp b/manifests/conf.pp index fb29d1d..3b2d540 100644 --- a/manifests/conf.pp +++ b/manifests/conf.pp @@ -10,19 +10,31 @@ # Also configures which service file a dropin will be created for, # along with which service should be notified that its environment # was updated. -# @param path -# Absolute path to the configuration file. Should generally not be -# manually set. +# @param absolutepath +# Absolute path to the configuration file. +# If this is left unset, then it defaults to +# `${concourse::confdir::conf_dir}/${relative_path}`. +# +# It's recommended to keep it that way. +# @param relative_path +# Basename of the generated environment file. # @param ensure # @api private define concourse::conf ( Hash[String, Any] $env, String $service, - Stdlib::Absolutepath $path = "${concourse::confdir::conf_dir}/${name}", + Optional[Stdlib::Absolutepath] $absolutepath = undef, + String $relative_path = $name, Enum['absent', 'present'] $ensure = 'present', ) { include concourse::confdir + if $absolutepath { + $path = $absolutepath + } else { + $path = "${concourse::confdir::conf_dir}/${relative_path}" + } + file { $path: ensure => $ensure, content => epp("${module_name}/env.epp", { 'entries' => $env }), -- cgit v1.2.3