From 140baa1942c26e800860bd265f982d635a0c6125 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 24 Jul 2017 13:48:03 -0400 Subject: [PATCH 1/4] Do not test with ruby 2.3.1 as Puppet 4 never supported it --- .travis.yml | 19 ------------------- README.md | 4 ++-- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53546cd..6382309 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ rvm: - 1.9.3 - 2.0.0 - 2.1.0 - - 2.3.1 env: matrix: @@ -78,24 +77,6 @@ matrix: env: PUPPET_GEM_VERSION="~> 4" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 4" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.3.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.5.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.6.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.7.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.8.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" notifications: email: false diff --git a/README.md b/README.md index 804e4a3..351a575 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ This module may be used with a simple `include ::ssh` # Compatibility This module has been tested to work on the following systems with Puppet -versions v3, v3 with future parser and v4 with Ruby versions 1.8.7 (Puppet v3 -only), 1.9.3, 2.0.0, 2.1.0 and 2.3.1 (Puppet v4 only). +versions v3, v3 with future parser, and v4 with Ruby versions 1.8.7 (Puppet v3 +only), 1.9.3, 2.0.0 and 2.1.0. See .travis.yml for the exact matrix. * Debian 7 * EL 5 From a5526568343683c2547e6dda3ad433aaab8e2472 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 24 Jul 2017 13:48:31 -0400 Subject: [PATCH 2/4] Support only latest Puppet v3 and later versions of Puppet v4 --- .travis.yml | 107 +++++++++++++++++++--------------------------------- Gemfile | 41 ++++++++++---------- README.md | 2 +- Rakefile | 12 ++---- 4 files changed, 64 insertions(+), 98 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6382309..b44dd70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,17 @@ --- language: ruby -rvm: - - 1.8.7 - - 1.9.3 - - 2.0.0 - - 2.1.0 +bundler_args: --without system_tests development -env: - matrix: - - PUPPET_GEM_VERSION="~> 3.1.0" - - PUPPET_GEM_VERSION="~> 3.2.0" - - PUPPET_GEM_VERSION="~> 3.3.0" - - PUPPET_GEM_VERSION="~> 3.4.0" - - 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.5.0" - - PUPPET_GEM_VERSION="~> 4.6.0" - - PUPPET_GEM_VERSION="~> 4.7.0" - - PUPPET_GEM_VERSION="~> 4.8.0" - - PUPPET_GEM_VERSION="~> 4.9.0" - - PUPPET_GEM_VERSION="~> 4" +cache: bundler + +before_install: + - bundle -v + - rm Gemfile.lock || true + - gem update --system + - gem update bundler + - gem --version + - bundle -v sudo: false @@ -36,47 +19,35 @@ script: 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec' matrix: fast_finish: true - exclude: - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.1.0 - 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.5.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.6.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.7.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.8.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 4" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 4" + include: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - 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" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4" notifications: email: false diff --git a/Gemfile b/Gemfile index 65ffa5d..ca6cc29 100644 --- a/Gemfile +++ b/Gemfile @@ -6,27 +6,28 @@ else gem 'puppet', :require => false end -gem 'facter', '>= 1.7.0' -gem 'rspec-puppet', '~> 2.0' -gem 'puppet-lint', '~> 2.0' -gem 'puppet-lint-absolute_classname-check' -gem 'puppet-lint-alias-check' -gem 'puppet-lint-empty_string-check' -gem 'puppet-lint-file_ensure-check' -gem 'puppet-lint-file_source_rights-check' -gem 'puppet-lint-leading_zero-check' -gem 'puppet-lint-spaceship_operator_without_tag-check' -gem 'puppet-lint-trailing_comma-check' -gem 'puppet-lint-undef_in_function-check' -gem 'puppet-lint-unquoted_string-check' -gem 'puppet-lint-variable_contains_upcase' +gem 'facter', '>= 1.7.0', :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 +gem 'puppet-lint-empty_string-check', :require => false +gem 'puppet-lint-file_ensure-check', :require => false +gem 'puppet-lint-file_source_rights-check', :require => false +gem 'puppet-lint-leading_zero-check', :require => false +gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false +gem 'puppet-lint-trailing_comma-check', :require => false +gem 'puppet-lint-undef_in_function-check', :require => false +gem 'puppet-lint-unquoted_string-check', :require => false +gem 'puppet-lint-variable_contains_upcase', :require => false -gem 'rspec', '~> 2.0' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' -gem 'rake', '~> 10.0' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' -gem 'json', '<= 1.8' if RUBY_VERSION < '2.0.0' -gem 'json_pure', '<= 2.0.1' if RUBY_VERSION < '2.0.0' -gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION < '1.9' -gem 'metadata-json-lint' if RUBY_VERSION >= '1.9' +gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0' +gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0' +gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'metadata-json-lint', '1.0.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.0' +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' diff --git a/README.md b/README.md index 351a575..1acc511 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This module may be used with a simple `include ::ssh` This module has been tested to work on the following systems with Puppet versions v3, v3 with future parser, and v4 with Ruby versions 1.8.7 (Puppet v3 -only), 1.9.3, 2.0.0 and 2.1.0. See .travis.yml for the exact matrix. +only), 1.9.3, 2.0.0 and 2.1.9. See .travis.yml for the exact matrix. * Debian 7 * EL 5 diff --git a/Rakefile b/Rakefile index f2f0456..93b6400 100644 --- a/Rakefile +++ b/Rakefile @@ -3,17 +3,11 @@ require 'puppet-lint/tasks/puppet-lint' PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_140chars') PuppetLint.configuration.relative = true -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] +PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp', 'vendor/**/*.pp'] -desc 'Validate manifests, templates, and ruby files' +desc 'Validate manifests, templates, ruby files and shell scripts' task :validate do - Dir['manifests/**/*.pp'].each do |manifest| - sh "puppet parser validate --noop #{manifest}" - end - Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| + Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ end - Dir['templates/**/*.erb'].each do |template| - sh "erb -P -x -T '-' #{template} | ruby -c" - end end From 82f436c6b8bd9e7975384c7e4b14bd2bc61f5444 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 24 Jul 2017 13:54:13 -0400 Subject: [PATCH 3/4] Remove trailing whitespace and convert tabs into two spaces --- spec/classes/init_spec.rb | 46 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index bf9134c..aa2270d 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -327,22 +327,22 @@ describe 'ssh' do 'aes256-cbc', ], :ssh_config_kexalgorithms => [ 'curve25519-sha256@libssh.org', - 'ecdh-sha2-nistp256', - 'ecdh-sha2-nistp384', - 'ecdh-sha2-nistp521', - 'diffie-hellman-group-exchange-sha256', - 'diffie-hellman-group-exchange-sha1', - 'diffie-hellman-group14-sha1', - 'diffie-hellman-group1-sha1', - ], + 'ecdh-sha2-nistp256', + 'ecdh-sha2-nistp384', + 'ecdh-sha2-nistp521', + 'diffie-hellman-group-exchange-sha256', + 'diffie-hellman-group-exchange-sha1', + 'diffie-hellman-group14-sha1', + 'diffie-hellman-group1-sha1', + ], :ssh_config_macs => [ 'hmac-md5-etm@openssh.com', 'hmac-sha1-etm@openssh.com', ], :ssh_config_proxy_command => 'ssh -W %h:%p firewall.example.org', :ssh_config_global_known_hosts_file => '/etc/ssh/ssh_known_hosts2', :ssh_config_global_known_hosts_list => [ '/etc/ssh/ssh_known_hosts3', - '/etc/ssh/ssh_known_hosts4', - ], + '/etc/ssh/ssh_known_hosts4', + ], :ssh_config_user_known_hosts_file => [ '.ssh/known_hosts1', '.ssh/known_hosts2', ], @@ -398,7 +398,7 @@ describe 'ssh' do :sshd_config_match => { 'User JohnDoe' => [ 'AllowTcpForwarding yes', ], }, :sshd_config_challenge_resp_auth => 'no', :sshd_config_print_motd => 'no', - :sshd_config_print_last_log => 'no', + :sshd_config_print_last_log => 'no', :sshd_config_use_dns => 'no', :sshd_config_banner => '/etc/sshd_banner', :sshd_authorized_keys_command => '/path/to/command', @@ -410,7 +410,7 @@ describe 'ssh' do :sshd_password_authentication => 'no', :sshd_config_permitemptypasswords => 'no', :sshd_config_permituserenvironment => 'no', - :sshd_config_compression => 'no', + :sshd_config_compression => 'no', :sshd_pubkeyacceptedkeytypes => [ 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', @@ -439,14 +439,14 @@ describe 'ssh' do 'aes256-cbc', ], :sshd_config_kexalgorithms => [ 'curve25519-sha256@libssh.org', - 'ecdh-sha2-nistp256', - 'ecdh-sha2-nistp384', - 'ecdh-sha2-nistp521', - 'diffie-hellman-group-exchange-sha256', - 'diffie-hellman-group-exchange-sha1', - 'diffie-hellman-group14-sha1', - 'diffie-hellman-group1-sha1', - ], + 'ecdh-sha2-nistp256', + 'ecdh-sha2-nistp384', + 'ecdh-sha2-nistp521', + 'diffie-hellman-group-exchange-sha256', + 'diffie-hellman-group-exchange-sha1', + 'diffie-hellman-group14-sha1', + 'diffie-hellman-group1-sha1', + ], :sshd_config_macs => [ 'hmac-md5-etm@openssh.com', 'hmac-sha1-etm@openssh.com', ], @@ -466,7 +466,7 @@ describe 'ssh' do '2001:db8::dead:f00d', ], :sshd_config_tcp_keepalive => 'yes', - :sshd_config_use_privilege_separation => 'no', + :sshd_config_use_privilege_separation => 'no', :sshd_config_permittunnel => 'no', } end @@ -992,7 +992,7 @@ describe 'sshd_config_print_last_log param' do end end end - + describe 'sshd_config_compression param' do ['yes','no','delayed'].each do |value| context "set to #{value}" do @@ -2437,7 +2437,7 @@ describe 'sshd_config_print_last_log param' do end end end - + describe 'sshd_config_use_privilege_separation param' do ['yes','no','sandbox'].each do |value| context "set to #{value}" do From 9c269790a6c03784177b1c5559fee600580742e4 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 24 Jul 2017 14:02:14 -0400 Subject: [PATCH 4/4] Support Puppet 5 --- .fixtures.yml | 2 +- .travis.yml | 6 ++++-- Gemfile | 4 ++++ README.md | 7 ++++--- metadata.json | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index dd0851a..d0ec0d9 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -8,6 +8,6 @@ fixtures: ref: 'v1.4.1' firewall: repo: 'https://github.com/puppetlabs/puppetlabs-firewall.git' - ref: '0.2.1' + ref: '1.9.0' symlinks: ssh: "#{source_dir}" diff --git a/.travis.yml b/.travis.yml index b44dd70..1551752 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ --- language: ruby -bundler_args: --without system_tests development - cache: bundler before_install: @@ -48,6 +46,10 @@ matrix: env: PUPPET_GEM_VERSION="~> 4.10.0" - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4" + - rvm: 2.4.1 + env: PUPPET_GEM_VERSION="~> 5.0.0" + - rvm: 2.4.1 + env: PUPPET_GEM_VERSION="~> 5" notifications: email: false diff --git a/Gemfile b/Gemfile index ca6cc29..2ae20fb 100644 --- a/Gemfile +++ b/Gemfile @@ -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 < '5.0' + gem 'semantic_puppet', :require => false +end diff --git a/README.md b/README.md index 1acc511..35a7a02 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ This module may be used with a simple `include ::ssh` # Compatibility -This module has been tested to work on the following systems with Puppet -versions v3, v3 with future parser, and v4 with Ruby versions 1.8.7 (Puppet v3 -only), 1.9.3, 2.0.0 and 2.1.9. See .travis.yml for the exact matrix. +This module has been tested to work on the following systems with the +latest Puppet v3, v3 with future parser, last few releases of v4 and +Puppet v5. See .travis.yml for the exact matrix of supported Puppet and +ruby versions. * Debian 7 * EL 5 diff --git a/metadata.json b/metadata.json index e1d8adb..d999865 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 3.0.0 < 5.0.0" + "version_requirement": ">= 3.0.0 < 6.0.0" } ], "operatingsystem_support": [ @@ -89,6 +89,6 @@ "dependencies": [ {"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"}, {"name":"ghoneycutt/common","version_requirement":">= 1.4.1 < 2.0.0"}, - {"name":"puppetlabs/firewall","version_requirement":">= 0.2.1 < 2.0.0"} + {"name":"puppetlabs/firewall","version_requirement":">= 1.9.0 < 2.0.0"} ] }