diff --git a/.travis.yml b/.travis.yml index 3445216..4dc49e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ matrix: fast_finish: true include: - rvm: 1.9.3 - env: PUPPET_VERSION=3.7.4 + env: PUPPET_VERSION=3.8.7 - rvm: 2.0.0 - env: PUPPET_VERSION=3.7.4 + env: PUPPET_VERSION=3.8.7 - rvm: 2.0.0 - env: PUPPET_VERSION=3.7.4 FUTURE_PARSER="yes" + env: PUPPET_VERSION=3.8.7 FUTURE_PARSER="yes" diff --git a/Gemfile b/Gemfile index 5c79c61..77f8fc1 100644 --- a/Gemfile +++ b/Gemfile @@ -11,3 +11,7 @@ gem 'puppet-lint', '>=0.3.2' gem 'puppetlabs_spec_helper', '>=0.2.0' gem 'rake', '>=0.9.2.2' gem 'librarian-puppet', '>=1.0.0' + +if RUBY_VERSION.to_i < 2.0 + gem 'json_pure', '< 2.0.2' +end diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 9bae8b0..0323d7d 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -94,9 +94,14 @@ }.to raise_error(/Setting \$config_keys_manage false and \$chrony_password at same time in chrony is not possible\./) } end context 'on any other system' do + let(:facts){ + { + :osfamily => 'Debian', + } + } it { expect { should compile - }.to raise_error(/The chrony module is not supported on an based system\./) } + }.to raise_error(/The chrony module is not supported on an Debian based system\./) } end end diff --git a/templates/chrony.conf.archlinux.erb b/templates/chrony.conf.archlinux.erb index c757e98..61b415e 100644 --- a/templates/chrony.conf.archlinux.erb +++ b/templates/chrony.conf.archlinux.erb @@ -46,8 +46,8 @@ ! server ntp0.your-isp.com ! server ntp1.your-isp.com ! server ntp.public-server.org -<% if @servers.is_a?(Hash) then @servers.each do |server, options| -%> -server <%= server %> <%= options.join(' ') %> +<% if @servers.is_a?(Hash) then @servers.keys.sort.each do |server| -%> +server <%= server %> <%= @servers[server].join(' ') %> <% end else Array(@servers).each do |server| -%> server <%= server %> iburst <% end end -%> diff --git a/templates/chrony.conf.redhat.erb b/templates/chrony.conf.redhat.erb index 97836d6..366baf9 100644 --- a/templates/chrony.conf.redhat.erb +++ b/templates/chrony.conf.redhat.erb @@ -1,7 +1,7 @@ # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). -<% if @servers.is_a?(Hash) then @servers.each do |server, options| -%> -server <%= server %> <%= options.join(' ') %> +<% if @servers.is_a?(Hash) then @servers.keys.sort.each do |server| -%> +server <%= server %> <%= @servers[server].join(' ') %> <% end else Array(@servers).each do |server| -%> server <%= server %> iburst <% end end -%>