# @summary Sets up a environment file. # # Configures an environment file along with a systemd dropin unit for # loading that file. # # @param env # Environment to set. # @param service # Which service this environment belongs to. # 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 ensure # @api private define concourse::conf ( Hash[String, String] $env, String $service, Stdlib::Abspath $path = "${concourse::confdir::conf_dir}/${name}", Enum['absent', 'present'] $ensure = 'present', ) { include concourse::confdir file { $path: ensure => $ensure, content => epp("${module_name}/env.epp", { 'entries' => $env }), show_diff => false, mode => '0600', notify => Service[$service], } $dropin_content = @("EOF") [Service] EnvironmentFile=${path} | EOF systemd::dropin_file { "concourse-${name}.conf": ensure => $ensure, unit => $concourse::web::service_unit, content => $dropin_content, notify_service => true, } }