Showing with 41 additions and 12 deletions.
  1. +10 −1 .travis.yml
  2. +15 −1 Gemfile
  3. +2 −1 Rakefile
  4. +3 −1 manifests/init.pp
  5. +1 −1 metadata.json
  6. +10 −1 spec/classes/init_spec.rb
  7. +0 −6 spec/spec_helper.rb
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ env:
- PUPPET_GEM_VERSION="~> 3.6.0"
- PUPPET_GEM_VERSION="~> 3.7.0"
- PUPPET_GEM_VERSION="~> 3.8.0"
- PUPPET_GEM_VERSION="~> 3" PARSER="future"
- PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- PUPPET_GEM_VERSION="~> 4.0.0"
- PUPPET_GEM_VERSION="~> 4.1.0"
- PUPPET_GEM_VERSION="~> 4.2.0"
- PUPPET_GEM_VERSION="~> 4.3.0"
- PUPPET_GEM_VERSION="~> 4"
- PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"

sudo: false

Expand All @@ -46,8 +48,15 @@ matrix:
env: PUPPET_GEM_VERSION="~> 4.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.2.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.3.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"


notifications:
email: false
16 changes: 15 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@ end

gem 'metadata-json-lint'
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet'
gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-alias-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-file_source_rights-check'
gem 'puppet-lint-fileserver-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'

# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
# rake >=11 does not support ruby 1.8.7
gem 'rspec', '~> 2.0'
gem 'rake', '~> 10.0'
end

3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.relative = true
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]

desc 'Validate manifests, templates, and ruby files'
desc 'Run puppet in noop mode and check for syntax errors.'
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$default_nsswitch_printers = undef
$default_nsswitch_auth_attr = undef
$default_nsswitch_prof_attr = undef
$default_nsswitch_project = undef
}
'RedHat': {
if $::operatingsystemmajrelease == '7' {
Expand Down Expand Up @@ -91,6 +92,7 @@
$default_nsswitch_printers = undef
$default_nsswitch_auth_attr = undef
$default_nsswitch_prof_attr = undef
$default_nsswitch_project = undef
}
'Solaris': {
$default_passwd = 'files'
Expand Down Expand Up @@ -128,7 +130,7 @@
$shadow_real = $shadow
}
validate_string($shadow_real)

if $sudoers == 'USE_DEFAULTS' {
$sudoers_real = $default_sudoers
} else {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghoneycutt-nsswitch",
"version": "1.4.0",
"version": "1.5.0",
"author": "ghoneycutt",
"summary": "Manage nsswitch",
"license": "Apache-2.0",
Expand Down
11 changes: 10 additions & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@

['RedHat','Suse','Debian'].each do |platform|
context "on osfamily #{platform}" do
let(:facts) { { :osfamily => platform } }
if platform = 'RedHat'
let(:facts) do
{
:osfamily => platform,
:operatingsystemmajrelease => '6',
}
end
else
let(:facts) { { :osfamily => platform } }
end

it { should contain_class('nsswitch') }

Expand Down
6 changes: 0 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |config|
config.before :each do
Puppet[:parser] = 'future' if ENV['PARSER'] == 'future'
end
end