Skip to content

Commit

Permalink
Merge pull request voxpupuli#413 from bastelfreak/systemd3
Browse files Browse the repository at this point in the history
migrate prometheus service file erb->epp
  • Loading branch information
bastelfreak authored Jan 6, 2020
2 parents e3f558c + 1fed2a9 commit a9d12c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
8 changes: 7 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,13 @@
}
'systemd': {
systemd::unit_file {'prometheus.service':
content => template('prometheus/prometheus.systemd.erb'),
content => epp("${module_name}/prometheus.systemd.epp", {
'user' => $prometheus::server::user,
'group' => $prometheus::server::group,
'daemon_flags' => $daemon_flags,
'max_open_files' => $max_open_files,
'bin_dir' => $prometheus::server::bin_dir,
}),
notify => $notify,
}
if versioncmp($facts['puppetversion'],'6.1.0') < 0 {
Expand Down
26 changes: 26 additions & 0 deletions templates/prometheus.systemd.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<%- | String[1] $user,
String[1] $group,
Array[String] $daemon_flags,
Optional[Integer] $max_open_files,
Stdlib::Absolutepath $bin_dir,
| -%>
# THIS FILE IS MANAGED BY PUPPET
[Unit]
Description=Prometheus Monitoring framework
Wants=basic.target
After=basic.target network.target

[Service]
User=<%= $user %>
Group=<%= $group %>
ExecStart=<%= $bin_dir %>/prometheus \
<%= $daemon_flags.join(" \\\n ") %>
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
<% if $max_open_files { -%>
LimitNOFILE=<%= $max_open_files %>
<% } -%>

[Install]
WantedBy=multi-user.target
20 changes: 0 additions & 20 deletions templates/prometheus.systemd.erb

This file was deleted.

0 comments on commit a9d12c1

Please sign in to comment.