From 140508f8a0424e92ddee7c526acc6c470468e720 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Sat, 11 Jul 2015 18:36:12 -0700 Subject: [PATCH] Add Gemfile and puppet 4 checks In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. This patch also corrects lint errors caught by the puppet-lint-absolute_classname-check and puppet-lint-empty_string-check gems. We disable the disable_arrow_alignment check in the Rakefile. Previously, the system version of puppet-lint that was being run by 'rake lint' was too old to catch this. When using 'bundle exec rake lint' the gem is new enough to catch this. Whether we want to actually fix these lint errors is a different discussion, so this patch disables the check for now. Change-Id: Ib44f2d6ac941e6fed118a5ff78bddd3d0f0a40b5 --- .gitignore | 2 ++ Gemfile | 32 ++++++++++++++++++++++++++++++++ Rakefile | 3 ++- manifests/function/customdir.pp | 1 - manifests/init.pp | 6 +++--- 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 Gemfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dade81e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Gemfile.lock +.bundled_gems/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..94a1a95 --- /dev/null +++ b/Gemfile @@ -0,0 +1,32 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'puppetlabs_spec_helper', :require => false + + gem 'metadata-json-lint' + # This is nice and all, but let's not worry about it until we've actually + # got puppet 4.x sorted + # gem 'puppet-lint-param-docs' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-absolute_template_path' + gem 'puppet-lint-trailing_newline-check' + + # Puppet 4.x related lint checks + gem 'puppet-lint-unquoted_string-check' + # Hold off on the empty string check for now + gem 'puppet-lint-empty_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-numericvariable' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-undef_in_function-check' + + if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false + else + gem 'puppet', '~> 3.0', :require => false + end + +end + +# vim:ft=ruby diff --git a/Rakefile b/Rakefile index 7f22329..66c2b73 100644 --- a/Rakefile +++ b/Rakefile @@ -5,4 +5,5 @@ PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_autoloader_layout') PuppetLint.configuration.send('disable_class_inherits_from_params_class') -PuppetLint.configuration.send('disable_class_parameter_defaults') \ No newline at end of file +PuppetLint.configuration.send('disable_class_parameter_defaults') +PuppetLint.configuration.send('disable_arrow_alignment') diff --git a/manifests/function/customdir.pp b/manifests/function/customdir.pp index 494f020..002f864 100644 --- a/manifests/function/customdir.pp +++ b/manifests/function/customdir.pp @@ -20,7 +20,6 @@ # define asterisk::function::customdir( ) { - include asterisk File { group => 'asterisk', diff --git a/manifests/init.pp b/manifests/init.pp index 5beee0f..c4a4ac9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,10 +20,10 @@ # # == Class: asterisk class asterisk ( - $asterisk_conf_source = '', - $modules_conf_source = '', + $asterisk_conf_source = undef, + $modules_conf_source = undef, ) { - include asterisk::server::command + include ::asterisk::server::command yumrepo { 'asteriskcurrent': baseurl => 'http://packages.asterisk.org/centos/$releasever/current/$basearch/',