Skip to content

Commit

Permalink
deploy env_file_path on server
Browse files Browse the repository at this point in the history
Without this change, when the install_method is set to `package` and
init_style is set to `none`, the various `prometheus::server` settings
will never do anything because we stop touching the systemd config
file.

By deploying the env_file_path on the server, we allow the "Debian
package" setup (install_method=package and init_style=none) to
propagate the daemon_flags correctly.

By default, the Debian systemd.service file has this entry:

    EnvironmentFile=/etc/default/prometheus
    ExecStart=/usr/bin/prometheus $ARGS

... which makes it use the ARGS define in the "default" config
file.

This is a subset of voxpupuli#303, which should hopefully pass tests and be
more manageable.

Closes: voxpupuli#323
  • Loading branch information
anarcat committed Feb 23, 2021
1 parent 921f397 commit 02a1e6a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@
default => undef,
}

if $prometheus::env_file_path {
file { "${prometheus::env_file_path}/prometheus":
mode => '0644',
owner => 'root',
group => '0', # Darwin uses wheel
content => "ARGS='${join(sort($daemon_flags), ' ')}'\n",
notify => $notify,
}
}

case $prometheus::server::init_style { # lint:ignore:case_without_default
'upstart': {
file { '/etc/init/prometheus.conf':
Expand Down

0 comments on commit 02a1e6a

Please sign in to comment.