Showing with 47 additions and 15 deletions.
  1. +2 −2 .fixtures.yml
  2. +24 −1 .travis.yml
  3. +7 −4 Gemfile
  4. +5 −1 README.md
  5. +2 −2 metadata.json
  6. +7 −5 spec/classes/init_spec.rb
4 changes: 2 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fixtures:
repositories:
stdlib:
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '3.2.0'
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
symlinks:
hosts: "#{source_dir}"
25 changes: 24 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,18 @@ env:
- PUPPET_GEM_VERSION="~> 3.2.0"
- PUPPET_GEM_VERSION="~> 3.3.0"
- PUPPET_GEM_VERSION="~> 3.4.0"
- PUPPET_GEM_VERSION="~> 3.5.1"
- PUPPET_GEM_VERSION="~> 3.5.0"
- PUPPET_GEM_VERSION="~> 3.6.0"
- PUPPET_GEM_VERSION="~> 3.7.0"
- PUPPET_GEM_VERSION="~> 3.8.0"
- 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.4.0"
- PUPPET_GEM_VERSION="~> 4"
- PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"

sudo: false

Expand All @@ -34,6 +43,20 @@ matrix:
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.0.0"
- rvm: 1.8.7
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.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4" STRICT_VARIABLES="yes"

notifications:
email: false
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
Expand All @@ -7,12 +7,15 @@ else
end

gem 'metadata-json-lint'
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 1.0.0'
gem 'puppetlabs_spec_helper', '>= 1.1.1'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet', '~>1.0'
gem 'rspec-puppet'
gem 'puppet-lint'

# 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 'rake', '~> 10.0'
gem 'rspec', '~> 2.0'
end

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ and optionally purge unmanaged entries.

# Compatibility

This module targets Puppet v3 with Ruby versions 1.8.7, 1.9.3, 2.0.0 and 2.1.0. It should work with any *nix based system that uses `/etc/hosts`.
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.0.

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

===

Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghoneycutt-hosts",
"version": "2.2.4",
"version": "2.3.0",
"author": "ghoneycutt",
"summary": "Manages host entries",
"description": "Can ensure entries for localhost, localhost6, and $::fqdn,\nincluding aliases and optionally purge unmanaged entries.",
Expand Down Expand Up @@ -48,6 +48,6 @@
}
],
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 6.0.0"}
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"}
]
}
12 changes: 7 additions & 5 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'spec_helper'
describe 'hosts' do

let(:facts) { { :ipaddress => '10.1.2.3' } }
it { should compile.with_all_deps }

context 'with default parameter settings' do
Expand Down Expand Up @@ -71,7 +72,7 @@
it {
should contain_host('localhost.localdomain').with({
'ensure' => 'absent',
'host_aliases' => '',
'host_aliases' => nil,
'ip' => '127.0.0.1',
'target' => '/etc/hosts',
})
Expand Down Expand Up @@ -121,7 +122,7 @@
it {
should contain_host('localhost6.localdomain6').with({
'ensure' => 'absent',
'host_aliases' => '',
'host_aliases' => nil,
'ip' => '::1',
'target' => '/etc/hosts',
})
Expand Down Expand Up @@ -531,7 +532,8 @@
end

context 'with hosts defined' do
let(:params) { { :host_entries => {
let(:facts) { { :ipaddress => '10.0.0.5' } }
let(:params) { { :host_entries => {
'myhost.example.com' => {
'ip' => '10.0.0.5',
'host_aliases' => ['myhost'],
Expand All @@ -558,8 +560,8 @@
end

context 'with host_entries containing post for fqdn' do
let(:facts) { { :fqdn => 'myhost.example.com',
:ip => '10.0.0.5',} }
let(:facts) { { :fqdn => 'myhost.example.com',
:ipaddress => '10.0.0.5',} }
let(:params) {
{ :host_entries => {
'myhost.example.com' => {
Expand Down