Showing with 54 additions and 43 deletions.
  1. +7 −0 .fixtures-puppetv3.yml
  2. +3 −0 .fixtures.yml
  3. +12 −20 .travis.yml
  4. +5 −1 Gemfile
  5. +1 −1 LICENSE
  6. +3 −3 README.md
  7. +3 −2 metadata.json
  8. +16 −16 spec/classes/init_spec.rb
  9. +4 −0 spec/spec_helper.rb
7 changes: 7 additions & 0 deletions .fixtures-puppetv3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fixtures:
repositories:
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
symlinks:
hosts: "#{source_dir}"
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
fixtures:
repositories:
host:
repo: 'git://github.com/puppetlabs/puppetlabs-host_core.git'
ref: '1.0.1'
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
Expand Down
32 changes: 12 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,27 @@ matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml" FUTURE_PARSER="yes"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml" FUTURE_PARSER="yes"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 3"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.5.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.6.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.7.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.8.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.9.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.10.0"
env: PUPPET_GEM_VERSION="~> 3" FIXTURES_YML=".fixtures-puppetv3.yml" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 2.4.1
env: PUPPET_GEM_VERSION="~> 5"
- rvm: 2.5.1
env: PUPPET_GEM_VERSION="~> 6"

notifications:
email: false
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ else
end

gem 'facter', '>= 1.7.0', :require => false
gem 'rspec-puppet', :require => false
gem 'rspec-puppet', '>= 2.4.0', :require => false
gem 'puppet-lint', '~> 2.0', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-alias-check', :require => false
Expand All @@ -32,3 +32,7 @@ gem 'metadata-json-lint' if RUBY_VERSION >= '2.0'
gem 'puppetlabs_spec_helper', '2.0.2', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'puppetlabs_spec_helper', '>= 2.0.0', :require => false if RUBY_VERSION >= '1.9'
gem 'parallel_tests', '<= 2.9.0', :require => false if RUBY_VERSION < '2.0.0'

if puppetversion && puppetversion < '5.0'
gem 'semantic_puppet', :require => false
end
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2010-2017 Garrett Honeycutt <code@garretthoneycutt.com>
Copyright (C) 2010-2018 Garrett Honeycutt <code@garretthoneycutt.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ and optionally purge unmanaged entries.

# Compatibility

This module is built for use with Puppet v3 (with and without the future
parser) and Puppet v4 on the following platforms and supports Ruby versions
1.8.7, 1.9.3, 2.0.0 and 2.1.9. See .travis.yml for matrix.
This module has been tested to work on the following systems with the
latest Puppet v3, v3 with future parser, v4, v5 and v6. See `.travis.yml`
for the exact matrix of supported Puppet and ruby versions.

It should work with any *nix based system that uses `/etc/hosts`.

Expand Down
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghoneycutt-hosts",
"version": "2.6.0",
"version": "2.7.0",
"author": "ghoneycutt",
"summary": "Manages host entries",
"description": "Can ensure entries for localhost, localhost6, and $::fqdn,\nincluding aliases and optionally purge unmanaged entries.",
Expand All @@ -9,9 +9,10 @@
"project_page": "https://github.com/ghoneycutt/puppet-module-hosts",
"issues_url": "https://github.com/ghoneycutt/puppet-module-hosts/issues",
"requirements": [
{"name":"puppet","version_requirement":">= 3.0.0 < 5.0.0"}
{"name":"puppet","version_requirement":">= 3.0.0 < 7.0.0"}
],
"dependencies": [
{"name":"puppetlabs/host_core","version_requirement":">= 1.0.1 <2.0.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"}
],
"operatingsystem_support": [
Expand Down
32 changes: 16 additions & 16 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@
})
}

# # GH: rspec-puppet does not yet support checking for exported resources
# it {
# should contain_host('monkey.example.com').with({
# 'ensure' => 'present',
# 'host_aliases' => ['monkey'],
# 'ip' => '10.1.2.3',
# })
# }
it {
expect(exported_resources).to contain_host('monkey.example.com').with({
'ensure' => 'present',
'host_aliases' => ['monkey'],
'ip' => '10.1.2.3',
})
}

it { should contain_resources('host').with({'purge' => 'false'}) }
end
Expand Down Expand Up @@ -214,6 +213,8 @@

it { should_not contain_host('monkey.example.com') }

it { expect(exported_resources).not_to contain_host('monkey.example.com') }

it { should contain_resources('host').with({'purge' => 'false'}) }
end
end
Expand Down Expand Up @@ -255,14 +256,13 @@
})
}

# # GH: rspec-puppet does not yet support checking for exported resources
# it {
# should contain_host('monkey.example.com').with({
# 'ensure' => 'present',
# 'host_aliases' => ['monkey'],
# 'ip' => '10.1.2.3',
# })
# }
it {
expect(exported_resources).to contain_host('monkey.example.com').with({
'ensure' => 'present',
'host_aliases' => ['monkey'],
'ip' => '10.1.2.3',
})
}

it { should contain_resources('host').with({'purge' => 'false'}) }
end
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
RSpec.configure do |c|
c.mock_with :rspec
end

require 'puppetlabs_spec_helper/module_spec_helper'

RSpec.configure do |config|
Expand Down