From d922efd0f71cb518a9c569dee109f19fa1e39e38 Mon Sep 17 00:00:00 2001 From: Jeroen Hooyberghs Date: Mon, 26 Jun 2017 09:32:09 +0200 Subject: [PATCH 1/3] Use scoped variables --- manifests/daemon.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/daemon.pp b/manifests/daemon.pp index a59d09664..ac52f7540 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -5,11 +5,11 @@ $user, $group, - $install_method = $prometheus::params::install_method, - $download_extension = $prometheus::params::download_extension, - $os = $prometheus::params::os, - $arch = $prometheus::params::arch, - $bin_dir = $prometheus::params::bin_dir, + $install_method = $::prometheus::params::install_method, + $download_extension = $::prometheus::params::download_extension, + $os = $::prometheus::params::os, + $arch = $::prometheus::params::arch, + $bin_dir = $::prometheus::params::bin_dir, $package_name = undef, $package_ensure = undef, $manage_user = true, @@ -17,7 +17,7 @@ $manage_group = true, $purge = true, $options = '', - $init_style = $prometheus::params::init_style, + $init_style = $::prometheus::params::init_style, $service_ensure = 'running', $service_enable = true, $manage_service = true, From 9c91809a0bbac01fdb2948f888ab3824e015b4bc Mon Sep 17 00:00:00 2001 From: Jeroen Hooyberghs Date: Mon, 26 Jun 2017 10:41:37 +0200 Subject: [PATCH 2/3] Add documentation for the params --- manifests/daemon.pp | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/manifests/daemon.pp b/manifests/daemon.pp index ac52f7540..cdb63e564 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -1,3 +1,58 @@ +# Define: prometheus::daemon +# +# This define managed prometheus daemons that don't have their own class +# +# [*version*] +# The binary release version +# +# [*real_download_url*] +# Complete URL corresponding to the where the release binary archive can be downloaded +# +# [*notify_service*] +# The service to notify when something changes in this define +# +# [*user*] +# User which runs the service +# +# [*install_method*] +# Installation method: url or package +# +# [*download_extension*] +# Extension for the release binary archive +# +# [*os*] +# Operating system (linux is the only one supported) +# +# [*arch*] +# Architecture (amd64 or i386) +# +# [*bin_dir*] +# Directory where binaries are located +# +# [*package_name*] +# The binary package name +# +# [*package_ensure*] +# If package, then use this for package ensure default 'undef' +# +# [*manage_user*] +# Whether to create user or rely on external code for that +# +# [*extra_groups*] +# Extra groups of which the user should be a part +# +# [*manage_group*] +# Whether to create a group for or rely on external code for that +# +# [*service_ensure*] +# State ensured for the service (default 'running') +# +# [*service_enable*] +# Whether to enable the service from puppet (default true) +# +# [*manage_service*] +# Should puppet manage the service? (default true) +# define prometheus::daemon ( $version, $real_download_url, From 4f479786b2b0653bdf967d9a19f8b2db3d2136ce Mon Sep 17 00:00:00 2001 From: Jeroen Hooyberghs Date: Mon, 26 Jun 2017 10:43:54 +0200 Subject: [PATCH 3/3] Set default to installed, undef does not make any sense --- manifests/daemon.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/daemon.pp b/manifests/daemon.pp index cdb63e564..65c29158a 100644 --- a/manifests/daemon.pp +++ b/manifests/daemon.pp @@ -33,7 +33,7 @@ # The binary package name # # [*package_ensure*] -# If package, then use this for package ensure default 'undef' +# If package, then use this for package ensure default 'installed' # # [*manage_user*] # Whether to create user or rely on external code for that @@ -66,7 +66,7 @@ $arch = $::prometheus::params::arch, $bin_dir = $::prometheus::params::bin_dir, $package_name = undef, - $package_ensure = undef, + $package_ensure = 'installed', $manage_user = true, $extra_groups = [], $manage_group = true,