Skip to content

Commit

Permalink
pass options through env_vars if no control over init files
Browse files Browse the repository at this point in the history
The logic here is that if init_style is non, then we have no control
over the init files themselves *except* through the environment
file.

Typically, the way this works is there is a ARGS environment variable
that gets sucked into the systemd unit file (or the sysv init file).
  • Loading branch information
anarcat committed Feb 23, 2021
1 parent 04af92c commit 809b5bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,23 @@
'none': {}
}

unless $env_vars.empty {
if $init_style == 'none' and $install_method == 'package' {
$env_vars_merged = $env_vars + {
'ARGS' => $options,
}
} else {
$env_vars_merged = $env_vars
}

unless $env_vars_merged.empty {
file { "${env_file_path}/${name}":
mode => '0644',
owner => 'root',
group => '0', # Darwin uses wheel
content => epp(
'prometheus/daemon.env.epp',
{
'env_vars' => $env_vars,
'env_vars' => $env_vars_merged,
}
),
notify => $notify_service,
Expand Down

0 comments on commit 809b5bb

Please sign in to comment.