Skip to content

Commit

Permalink
Merge pull request #79 from bastelfreak/mysql
Browse files Browse the repository at this point in the history
replace validate_* with datatypes in mysqld_exporter
  • Loading branch information
alexjfisher authored Oct 23, 2017
2 parents 62b1cc1 + c29f0b1 commit e115453
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions manifests/mysqld_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,42 +90,39 @@
# [*version*]
# The binary release version
class prometheus::mysqld_exporter (
$arch = $::prometheus::params::arch,
$bin_dir = $::prometheus::params::bin_dir,
$cnf_config_path = $::prometheus::params::mysqld_exporter_cnf_config_path,
$cnf_host = $::prometheus::params::mysqld_exporter_cnf_host,
$cnf_password = $::prometheus::params::mysqld_exporter_cnf_password,
$cnf_port = $::prometheus::params::mysqld_exporter_cnf_port,
$cnf_socket = undef,
$cnf_user = $::prometheus::params::mysqld_exporter_cnf_user,
$config_mode = $::prometheus::params::config_mode,
$download_extension = $::prometheus::params::mysqld_exporter_download_extension,
$download_url = undef,
$download_url_base = $::prometheus::params::mysqld_exporter_download_url_base,
$extra_groups = $::prometheus::params::mysqld_exporter_extra_groups,
$extra_options = '',
$group = $::prometheus::params::mysqld_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::mysqld_exporter_package_ensure,
$package_name = $::prometheus::params::mysqld_exporter_package_name,
$purge_config_dir = true,
$restart_on_change = true,
$service_enable = true,
$service_ensure = 'running',
$user = $::prometheus::params::mysqld_exporter_user,
$version = $::prometheus::params::mysqld_exporter_version,
$arch = $::prometheus::params::arch,
$bin_dir = $::prometheus::params::bin_dir,
$cnf_config_path = $::prometheus::params::mysqld_exporter_cnf_config_path,
$cnf_host = $::prometheus::params::mysqld_exporter_cnf_host,
$cnf_password = $::prometheus::params::mysqld_exporter_cnf_password,
$cnf_port = $::prometheus::params::mysqld_exporter_cnf_port,
$cnf_socket = undef,
$cnf_user = $::prometheus::params::mysqld_exporter_cnf_user,
$config_mode = $::prometheus::params::config_mode,
$download_extension = $::prometheus::params::mysqld_exporter_download_extension,
$download_url = undef,
$download_url_base = $::prometheus::params::mysqld_exporter_download_url_base,
$extra_groups = $::prometheus::params::mysqld_exporter_extra_groups,
$extra_options = '',
$group = $::prometheus::params::mysqld_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::mysqld_exporter_package_ensure,
$package_name = $::prometheus::params::mysqld_exporter_package_name,
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Boolean $service_enable = true,
$service_ensure = 'running',
$user = $::prometheus::params::mysqld_exporter_user,
$version = $::prometheus::params::mysqld_exporter_version,
) inherits prometheus::params {

#Please provide the download_url for versions < 0.9.0
$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['mysqld_exporter'],
default => undef,
Expand Down

0 comments on commit e115453

Please sign in to comment.