From a56b641c78683ddcb763a7976162e326db501629 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Sat, 2 Mar 2013 16:09:38 -0700 Subject: [PATCH] cleanup code to pass puppet-lint and add the 'lint' rake target --- Rakefile | 5 +++++ manifests/gmetad.pp | 12 ++++++------ manifests/gmetad/config.pp | 17 +++++++++++++++-- manifests/gmetad/install.pp | 13 +++++++++++++ manifests/gmetad/service.pp | 13 +++++++++++++ manifests/gmond.pp | 10 +++++----- manifests/gmond/config.pp | 17 +++++++++++++++-- manifests/gmond/install.pp | 13 +++++++++++++ manifests/gmond/service.pp | 13 +++++++++++++ manifests/params.pp | 13 +++++++++++++ manifests/web.pp | 2 +- manifests/web/config.pp | 15 ++++++++++++++- manifests/web/install.pp | 13 +++++++++++++ 13 files changed, 139 insertions(+), 17 deletions(-) diff --git a/Rakefile b/Rakefile index cd3d379..5fbc7f4 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,6 @@ require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' + +PuppetLint.configuration.send("disable_class_inherits_from_params_class") +PuppetLint.configuration.send("disable_variable_scope") +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", 'tests/**/*.pp'] diff --git a/manifests/gmetad.pp b/manifests/gmetad.pp index c47698b..6c8eebb 100644 --- a/manifests/gmetad.pp +++ b/manifests/gmetad.pp @@ -12,7 +12,7 @@ # -name # -polling_interval # -address -# +# # defaults to: # [ { name => 'my cluster', address => 'localhost' } ], # @@ -24,15 +24,15 @@ # # # $clusters = [ -# { -# name => 'test', +# { +# name => 'test', # address => ['test1.example.org', 'test2.example.org'], # }, # ] # # class{ 'ganglia::gmetad': -# clusters => $clusters, -# gridname => 'my grid', +# clusters => $clusters, +# gridname => 'my grid', # } # # @@ -42,7 +42,7 @@ # # === Copyright # -# Copyright (C) 2012 Joshua Hoblitt +# Copyright (C) 2012-2013 Joshua Hoblitt # class ganglia::gmetad( diff --git a/manifests/gmetad/config.pp b/manifests/gmetad/config.pp index b321578..ebc6400 100644 --- a/manifests/gmetad/config.pp +++ b/manifests/gmetad/config.pp @@ -1,11 +1,24 @@ +# == Class: ganglia::gmetad::config +# +# installs the configuration file for gmetad +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmetad::config inherits ganglia::gmetad { file { $gmetad_service_config: ensure => present, owner => 'root', group => 'root', - mode => '0644', + mode => '0644', content => template($gmetad_service_erb), - notify => Class["ganglia::gmetad::service"], + notify => Class['ganglia::gmetad::service'], } } diff --git a/manifests/gmetad/install.pp b/manifests/gmetad/install.pp index 1594e59..b3790f7 100644 --- a/manifests/gmetad/install.pp +++ b/manifests/gmetad/install.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::gmetad::install +# +# installs the package that provides gmetad +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmetad::install inherits ganglia::gmetad { package { $gmetad_package_name: diff --git a/manifests/gmetad/service.pp b/manifests/gmetad/service.pp index 774178b..e1048a3 100644 --- a/manifests/gmetad/service.pp +++ b/manifests/gmetad/service.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::gmetad::service +# +# enables the gmetad service +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmetad::service inherits ganglia::gmetad { service { $gmetad_service_name: diff --git a/manifests/gmond.pp b/manifests/gmond.pp index fc326ef..65bf3ff 100644 --- a/manifests/gmond.pp +++ b/manifests/gmond.pp @@ -28,7 +28,7 @@ # -host # -port # -ttl -# +# # defaults to: # [ { mcast_join => '239.2.11.71', port => 8649, bind => '239.2.11.71' } ] # @@ -39,7 +39,7 @@ # -mcast_join # -port # -bind -# +# # defaults to: # [ { mcast_join => '239.2.11.71', port => 8649, ttl => 1 } ] # @@ -84,7 +84,7 @@ # # === Copyright # -# Copyright (C) 2012 Joshua Hoblitt +# Copyright (C) 2012-2013 Joshua Hoblitt # class ganglia::gmond ( @@ -104,8 +104,8 @@ validate_string($cluster_name) validate_string($cluster_owner) validate_string($cluster_latlong) - validate_string($cluster_lurl) - validate_string($cluster_location) + validate_string($cluster_url) + validate_string($host_location) validate_array($udp_send_channel) validate_array($udp_recv_channel) validate_array($tcp_accept_channel) diff --git a/manifests/gmond/config.pp b/manifests/gmond/config.pp index ce99db3..fd2389f 100644 --- a/manifests/gmond/config.pp +++ b/manifests/gmond/config.pp @@ -1,11 +1,24 @@ +# == Class: ganglia::gmond::config +# +# installs the configuration file for gmond +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmond::config { file { $gmond_service_config: ensure => present, owner => 'root', group => 'root', - mode => '0644', + mode => '0644', content => template($gmond_service_erb), - notify => Class["ganglia::gmond::service"], + notify => Class['ganglia::gmond::service'], } } diff --git a/manifests/gmond/install.pp b/manifests/gmond/install.pp index 9d5a39d..aa840b3 100644 --- a/manifests/gmond/install.pp +++ b/manifests/gmond/install.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::gmond::install +# +# installs the package that provides gmond +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmond::install { package { $gmond_package_name: diff --git a/manifests/gmond/service.pp b/manifests/gmond/service.pp index 268e5cb..c50ef59 100644 --- a/manifests/gmond/service.pp +++ b/manifests/gmond/service.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::gmond::service +# +# enables the gmond service +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::gmond::service { service { $gmond_service_name: diff --git a/manifests/params.pp b/manifests/params.pp index 55a0da0..0a4f9ee 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::params +# +# provides parameters for the ganglia module +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::params { $gmond_package_name = 'ganglia-gmond' $gmond_service_name = 'gmond' diff --git a/manifests/web.pp b/manifests/web.pp index bfbabf8..9762102 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -29,7 +29,7 @@ # # === Copyright # -# Copyright (C) 2012 Joshua Hoblitt +# Copyright (C) 2012-2013 Joshua Hoblitt # class ganglia::web( diff --git a/manifests/web/config.pp b/manifests/web/config.pp index 47009d9..dcc00cc 100644 --- a/manifests/web/config.pp +++ b/manifests/web/config.pp @@ -1,10 +1,23 @@ +# == Class: ganglia::web::config +# +# configure the ganglia web front end +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::web::config inherits ganglia::web { file { $web_php_config: ensure => present, owner => 'root', group => 'root', - mode => '0644', + mode => '0644', content => template($web_php_erb), } } diff --git a/manifests/web/install.pp b/manifests/web/install.pp index 0335180..9ade5ff 100644 --- a/manifests/web/install.pp +++ b/manifests/web/install.pp @@ -1,3 +1,16 @@ +# == Class: ganglia::web::install +# +# installs the package that provides the ganglia web front end +# +# === Authors +# +# Joshua Hoblitt +# +# === Copyright +# +# Copyright (C) 2012-2013 Joshua Hoblitt +# + class ganglia::web::install inherits ganglia::web { package { $web_package_name: