diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-20 22:44:52 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-20 22:44:52 +0200 |
commit | e54c695ae0d5e90ece866b489fe7bfbbbb5af0a7 (patch) | |
tree | 7cce5b10ffcb12c8b68eef27dcfeda80b495ab2a | |
parent | fixes (diff) | |
download | concourse-e54c695ae0d5e90ece866b489fe7bfbbbb5af0a7.tar.gz concourse-e54c695ae0d5e90ece866b489fe7bfbbbb5af0a7.tar.xz |
fixes
-rw-r--r-- | manifests/conf.pp | 20 |
1 files changed, 16 insertions, 4 deletions
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 }), |