Skip to content

Commit

Permalink
Merge pull request #78 from bastelfreak/process
Browse files Browse the repository at this point in the history
replace validate_* with datatypes in process_exporter
  • Loading branch information
alexjfisher committed Oct 23, 2017
2 parents c2cdaaa + d000d25 commit 62b1cc1
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions manifests/process_exporter.pp
Expand Up @@ -69,38 +69,34 @@
# [*version*]
# The binary release version
class prometheus::process_exporter(
$arch = $::prometheus::params::arch,
$bin_dir = $::prometheus::params::bin_dir,
$download_extension = $::prometheus::params::process_exporter_download_extension,
$download_url = undef,
$download_url_base = $::prometheus::params::process_exporter_download_url_base,
$extra_groups = $::prometheus::params::process_exporter_extra_groups,
$extra_options = '',
$config_mode = $::prometheus::params::config_mode,
$group = $::prometheus::params::process_exporter_group,
$init_style = $::prometheus::params::init_style,
$install_method = $::prometheus::params::install_method,
$manage_group = true,
$manage_service = true,
$manage_user = true,
$os = $::prometheus::params::os,
$package_ensure = $::prometheus::params::process_exporter_package_ensure,
$package_name = $::prometheus::params::process_exporter_package_name,
$purge_config_dir = true,
$restart_on_change = true,
$service_enable = true,
$service_ensure = 'running',
$user = $::prometheus::params::process_exporter_user,
$version = $::prometheus::params::process_exporter_version,
$config_path = $::prometheus::params::process_exporter_config_path,
$watched_processes = []
$arch = $::prometheus::params::arch,
$bin_dir = $::prometheus::params::bin_dir,
$download_extension = $::prometheus::params::process_exporter_download_extension,
$download_url = undef,
$download_url_base = $::prometheus::params::process_exporter_download_url_base,
$extra_groups = $::prometheus::params::process_exporter_extra_groups,
$extra_options = '',
$config_mode = $::prometheus::params::config_mode,
$group = $::prometheus::params::process_exporter_group,
$init_style = $::prometheus::params::init_style,
$install_method = $::prometheus::params::install_method,
Boolean $manage_group = true,
Boolean $manage_service = true,
Boolean $manage_user = true,
$os = $::prometheus::params::os,
$package_ensure = $::prometheus::params::process_exporter_package_ensure,
$package_name = $::prometheus::params::process_exporter_package_name,
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Boolean $service_enable = true,
$service_ensure = 'running',
$user = $::prometheus::params::process_exporter_user,
$version = $::prometheus::params::process_exporter_version,
$config_path = $::prometheus::params::process_exporter_config_path,
$watched_processes = []
) inherits prometheus::params {

$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")
validate_bool($purge_config_dir)
validate_bool($manage_user)
validate_bool($manage_service)
validate_bool($restart_on_change)
$notify_service = $restart_on_change ? {
true => Service['process-exporter'],
default => undef,
Expand Down

0 comments on commit 62b1cc1

Please sign in to comment.