Skip to content

Commit

Permalink
Update ntp to 286acba
Browse files Browse the repository at this point in the history
286acba Merge pull request #252 from anodelman/master
d4ef5a5 (BKR-147) add Gemfile setting for BEAKER_VERSION for puppet...
b6d8f57 Merge pull request #251 from cmurphy/rspec-puppet-2
dffe18d Update .travis.yml
fbb8043 Keep testing on puppet 2.7
78183a1 Fix lint warnings and ensure lint fails on warnings
44dd107 Remove unneeded dependencies
3a0e780 Update tests for rspec-puppet 2
  • Loading branch information
xbezdick committed Apr 2, 2015
1 parent e092a37 commit 4f86ea3
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ mod 'nssdb',
:git => 'https://github.com/rcritten/puppet-nssdb.git'

mod 'ntp',
:commit => 'c1eef64924a51a5fb7281a4ccd0f098f0effd270',
:commit => '286acbacdb9aaa3f1255d7486078730e380195f4',
:git => 'https://github.com/puppetlabs/puppetlabs-ntp'

mod 'openstack_extras',
Expand Down
6 changes: 6 additions & 0 deletions ntp/.sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
.travis.yml:
extras:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
spec/spec_helper.rb:
unmanaged: true
19 changes: 15 additions & 4 deletions ntp/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
---
sudo: false
language: ruby
bundler_args: --without system_tests
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
notifications:
email: false
24 changes: 20 additions & 4 deletions ntp/Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

def location_for(place, fake_version = nil)
if place =~ /^(git:[^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, { :require => false }]
end
end

group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-core', '3.1.7', :require => false
gem 'rspec-puppet', '~> 1.0', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
end

beaker_version = ENV['BEAKER_VERSION']
beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
group :system_tests do
gem 'beaker-rspec', :require => false
if beaker_version
gem 'beaker', *location_for(beaker_version)
end
if beaker_rspec_version
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
end

Expand Down
2 changes: 1 addition & 1 deletion ntp/Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
Expand Down
16 changes: 8 additions & 8 deletions ntp/manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#
class ntp::config inherits ntp {

if $keys_enable {
$directory = ntp_dirname($keys_file)
if $ntp::keys_enable {
$directory = ntp_dirname($ntp::keys_file)
file { $directory:
ensure => directory,
owner => 0,
group => 0,
mode => '0755',
ensure => directory,
owner => 0,
group => 0,
mode => '0755',
}
}

file { $config:
file { $ntp::config:
ensure => file,
owner => 0,
group => 0,
mode => '0644',
content => template($config_template),
content => template($ntp::config_template),
}

}
6 changes: 3 additions & 3 deletions ntp/manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
class ntp::install inherits ntp {

if $package_manage {
if $ntp::package_manage {

package { $package_name:
ensure => $package_ensure,
package { $ntp::package_name:
ensure => $ntp::package_ensure,
}

}
Expand Down
10 changes: 5 additions & 5 deletions ntp/manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#
class ntp::service inherits ntp {

if ! ($service_ensure in [ 'running', 'stopped' ]) {
if ! ($ntp::service_ensure in [ 'running', 'stopped' ]) {
fail('service_ensure parameter must be running or stopped')
}

if $service_manage == true {
if $ntp::service_manage == true {
service { 'ntp':
ensure => $service_ensure,
enable => $service_enable,
name => $service_name,
ensure => $ntp::service_ensure,
enable => $ntp::service_enable,
name => $ntp::service_name,
hasstatus => true,
hasrestart => true,
}
Expand Down
4 changes: 2 additions & 2 deletions ntp/spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@
})
end

it { expect{ subject }.to raise_error(
/^The ntp module is not supported on an unsupported based system./
it { expect{ catalogue }.to raise_error(
/The ntp module is not supported on an unsupported based system./
)}
end
end
Expand Down

0 comments on commit 4f86ea3

Please sign in to comment.