diff --git a/Puppetfile b/Puppetfile index 7719672ee..ee8fe7218 100644 --- a/Puppetfile +++ b/Puppetfile @@ -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', diff --git a/ntp/.sync.yml b/ntp/.sync.yml index 66a03c649..ac8379073 100644 --- a/ntp/.sync.yml +++ b/ntp/.sync.yml @@ -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 diff --git a/ntp/.travis.yml b/ntp/.travis.yml index 6cf8b0044..d1a0d7cd9 100644 --- a/ntp/.travis.yml +++ b/ntp/.travis.yml @@ -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 diff --git a/ntp/Gemfile b/ntp/Gemfile index 62c569397..fcd27d534 100644 --- a/ntp/Gemfile +++ b/ntp/Gemfile @@ -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 diff --git a/ntp/Rakefile b/ntp/Rakefile index e3be95b0b..181157e6e 100644 --- a/ntp/Rakefile +++ b/ntp/Rakefile @@ -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') diff --git a/ntp/manifests/config.pp b/ntp/manifests/config.pp index 91990ba11..e54feff0f 100644 --- a/ntp/manifests/config.pp +++ b/ntp/manifests/config.pp @@ -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), } } diff --git a/ntp/manifests/install.pp b/ntp/manifests/install.pp index 49f4044bf..9709d708d 100644 --- a/ntp/manifests/install.pp +++ b/ntp/manifests/install.pp @@ -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, } } diff --git a/ntp/manifests/service.pp b/ntp/manifests/service.pp index 3f1ada0b7..6bc951bf6 100644 --- a/ntp/manifests/service.pp +++ b/ntp/manifests/service.pp @@ -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, } diff --git a/ntp/spec/classes/ntp_spec.rb b/ntp/spec/classes/ntp_spec.rb index 4864e8883..522afbd00 100644 --- a/ntp/spec/classes/ntp_spec.rb +++ b/ntp/spec/classes/ntp_spec.rb @@ -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