Skip to content

Commit

Permalink
do not manage the systemd service file if using the package
Browse files Browse the repository at this point in the history
  • Loading branch information
anarcat committed Mar 21, 2019
1 parent 2058ff5 commit 215099a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
8 changes: 5 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
}
}
'systemd' : {
include 'systemd'
systemd::unit_file {'prometheus.service':
content => template('prometheus/prometheus.systemd.erb'),
if $prometheus::server::manage_systemd_unit {
include 'systemd'
systemd::unit_file {'prometheus.service':
content => template('prometheus/prometheus.systemd.erb'),
}
}
}
'sysv', 'redhat' : {
Expand Down
11 changes: 7 additions & 4 deletions manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
String $service_ensure = 'running',
Boolean $service_enable = true,
Boolean $manage_service = true,
Boolean $manage_systemd_unit = $install_method != 'package',
Hash[String, Scalar] $env_vars = {},
Optional[String] $env_file_path = $prometheus::env_file_path,
) {
Expand Down Expand Up @@ -172,10 +173,12 @@
}
}
'systemd' : {
include 'systemd'
systemd::unit_file {"${name}.service":
content => template('prometheus/daemon.systemd.erb'),
notify => $notify_service,
if $manage_systemd_unit {
include 'systemd'
systemd::unit_file {"${name}.service":
content => template('prometheus/daemon.systemd.erb'),
notify => $notify_service,
}
}
}
# service_provider returns redhat on CentOS using sysv, https://tickets.puppetlabs.com/browse/PUP-5296
Expand Down
9 changes: 5 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@
Boolean $manage_group,
Boolean $purge_config_dir,
Boolean $manage_user,
Hash $extra_alerts = {},
Hash $config_hash = {},
Hash $config_defaults = {},
String $os = downcase($facts['kernel']),
Hash $extra_alerts = {},
Hash $config_hash = {},
Hash $config_defaults = {},
Boolean $manage_systemd_unit = $install_method != 'package',
String $os = downcase($facts['kernel']),
Optional[Variant[Stdlib::HTTPUrl, Stdlib::Unixpath, String[1]]] $external_url = undef,
) {

Expand Down
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Boolean $service_enable = $prometheus::service_enable,
String $service_ensure = $prometheus::service_ensure,
Boolean $manage_service = $prometheus::manage_service,
Boolean $manage_systemd_unit = $prometheus::manage_systemd_unit,
Boolean $restart_on_change = $prometheus::restart_on_change,
String $init_style = $prometheus::init_style,
String $extra_options = $prometheus::extra_options,
Expand Down

0 comments on commit 215099a

Please sign in to comment.