From 921b27b418506fd4fb4644ff526fe0a9cc95e62a Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Fri, 13 Jul 2018 11:32:20 -0400 Subject: [PATCH] (SIMP-4009) Added OEL and Puppet 5 support (#9) SIMP-4009 #comment updated chkrootkit --- .gitlab-ci.yml | 243 ++++++++++++++++++--------- .puppet-lint.rc | 5 - .travis.yml | 113 ++++++++----- CHANGELOG | 3 + Gemfile | 5 +- build/rpm_metadata/requires | 4 - metadata.json | 11 +- spec/acceptance/nodesets/default.yml | 21 --- 8 files changed, 252 insertions(+), 153 deletions(-) delete mode 100644 build/rpm_metadata/requires delete mode 100644 spec/acceptance/nodesets/default.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6429999..84ea7d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,97 +1,182 @@ +# The testing matrix considers ruby/puppet versions supported by SIMP and PE: # +# https://puppet.com/docs/pe/2017.3/overview/component_versions_in_recent_pe_releases.html +# https://puppet.com/misc/puppet-enterprise-lifecycle +# https://puppet.com/docs/pe/2017.3/overview/getting_support_for_pe.html#standard-releases-and-long-term-support-releases +# ------------------------------------------------------------------------------ +# release pup ruby eol +# PE 2016.4 4.7 2.1.9 2018-10 (LTS) +# SIMP6.0.0 4.8 2.1.9 TBD +# PE 2017.2 4.10 2.1.9 2018-02-21 +# PE 2017.3 5.3 2.4.1 2018-07 +# PE 2018.1 ??? ????? ????-?? (LTS) --- -puppet-syntax: - stage: test - tags: - - docker - image: ruby:2.1 - script: - - bundle install +.cache_bundler: &cache_bundler + cache: + untracked: true + # A broad attempt at caching between runs (ala Travis CI) + key: "${CI_PROJECT_NAMESPACE}__bundler" + paths: + - '.vendor' + - 'vendor' + +.setup_bundler_env: &setup_bundler_env + before_script: + - 'echo Files in cache: $(find .vendor | wc -l) || :' + - 'export GEM_HOME=.vendor/gem_install' + - 'export BUNDLE_CACHE_PATH=.vendor/bundler' + - 'declare GEM_BUNDLER_VER=(-v ''~> ${BUNDLER_VERSION:-1.16.0}'')' + - declare GEM_INSTALL=(gem install --no-document) + - declare BUNDLER_INSTALL=(bundle install --no-binstubs --jobs $(nproc) --path=.vendor "${FLAGS[@]}") + - gem list -ie "${GEM_BUNDLE_VER[@]}" --silent bundler || "${GEM_INSTALL[@]}" --local "${GEM_BUNDLE_VER[@]}" bundler || "${GEM_INSTALL[@]}" "${GEM_BUNDLE_VER[@]}" bundler + - 'rm -rf pkg/ || :' + - bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL[@]}" --local || "${BUNDLER_INSTALL[@]}") + + +.validation_checks: &validation_checks + script: - bundle exec rake syntax -puppet-lint: - stage: test - tags: - - docker - image: ruby:2.1 - script: - - bundle install + - bundle exec rake check:dot_underscore + - bundle exec rake check:test_file + - bundle exec rake pkg:check_version + - bundle exec rake pkg:compare_latest_tag - bundle exec rake lint -puppet-metadata: - stage: test - tags: + - bundle exec rake clean + - bundle exec puppet module build + +.spec_tests: &spec_tests + script: + - bundle exec rake spec + +stages: + - validation + - unit + - acceptance + - deploy + +# Puppet 4.7 for PE 2016.4 LTS Support (EOL: 2018-10-21) +# See: https://puppet.com/misc/puppet-enterprise-lifecycle +# -------------------------------------- +pup4_7-validation: + stage: validation + tags: - docker image: ruby:2.1 - script: - - bundle install - - bundle exec rake metadata -unit-test-ruby-2.1: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.7.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4_7-unit: + stage: unit + tags: - docker image: ruby:2.1 - script: - - bundle install - - bundle exec rake spec -unit-test-ruby-2.2: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.7.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Puppet 4.8 for SIMP 6.0 + 6.1 support +# -------------------------------------- +pup4_8-validation: + stage: validation + tags: - docker - image: ruby:2.2 - allow_failure: true - script: - - bundle install - - bundle exec rake spec -unit-test-ruby-2.3: - stage: test - tags: + image: ruby:2.1 + variables: + PUPPET_VERSION: '~> 4.8.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4_8-unit: + stage: unit + tags: - docker - image: ruby:2.3 - allow_failure: true - script: - - bundle install - - bundle exec rake spec + image: ruby:2.1 + variables: + PUPPET_VERSION: '~> 4.8.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + -# For PE LTS Support +# Puppet 4.10 for PE 2017.2 support (EOL:2018-02-21) # See: https://puppet.com/misc/puppet-enterprise-lifecycle -puppet4.7-syntax: - stage: test - tags: +# -------------------------------------- +pup4_10-validation: + stage: validation + tags: - docker image: ruby:2.1 - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake syntax -unit-test-puppet4.7-ruby-2.1: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.10.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup4_10-unit: + stage: unit + tags: - docker image: ruby:2.1 - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec -unit-test-puppet4.7-ruby-2.2: - stage: test - tags: + variables: + PUPPET_VERSION: '~> 4.10.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Puppet 5.3 for PE 2017.3 support (EOL: 2018-07) +# See: https://puppet.com/misc/puppet-enterprise-lifecycle +# -------------------------------------- +pup5_3-validation: + stage: validation + tags: + - docker + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.3.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup5_3-unit: + stage: unit + tags: - docker - image: ruby:2.2 - allow_failure: true - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec -unit-test-puppet4.7-ruby-2.3: - stage: test - tags: + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.3.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests + + +# Keep an eye on the latest puppet 5 +# ---------------------------------- +pup5_latest-validation: + stage: validation + tags: + - docker + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *validation_checks + +pup5_latest-unit: + stage: unit + tags: - docker - image: ruby:2.3 - allow_failure: true - script: - - PUPPET_VERSION=4.7 bundle install - - PUPPET_VERSION=4.7 bundle exec rake spec - -acceptance-test: - stage: test - tags: - - beaker - script: - - bundle install --no-binstubs --path=vendor - - bundle exec rake acceptance + image: ruby:2.4 + variables: + PUPPET_VERSION: '~> 5.0' + <<: *cache_bundler + <<: *setup_bundler_env + <<: *spec_tests diff --git a/.puppet-lint.rc b/.puppet-lint.rc index 2415788..71ffc7b 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,9 +1,4 @@ --log-format="%{path}:%{line}:%{check}:%{KIND}:%{message}" --relative ---no-class_inherits_from_params_class-check --no-140chars-check ---no-empty_string-check --no-trailing_comma-check -# This is here because the code can't handle lookups in parameters and we have -# a LOT of those ---no-parameter_order-check diff --git a/.travis.yml b/.travis.yml index 25bf007..8ef16c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,48 +8,81 @@ # PE 2017.2 4.10 2.1.9 TBD --- language: ruby -sudo: false cache: bundler -before_script: - - bundle update +sudo: false + bundler_args: --without development system_tests --path .vendor -before_install: rm Gemfile.lock || true -script: - - bundle exec rake test + notifications: email: false -rvm: - - 2.1.9 -env: - global: - - STRICT_VARIABLES=yes - matrix: - - PUPPET_VERSION="~> 4.8.2" FORGE_PUBLISH=true - - PUPPET_VERSION="~> 4.10.0" - - PUPPET_VERSION="~> 4.9.2" - - PUPPET_VERSION="~> 4.7.0" -matrix: - fast_finish: true - -before_deploy: - - 'bundle exec rake metadata_lint' - - 'bundle exec rake clobber' - - 'bundle exec rake spec_clean' - - "export PUPMOD_METADATA_VERSION=`ruby -r json -e \"puts JSON.parse(File.read('metadata.json')).fetch('version')\"`" - - '[[ $TRAVIS_TAG =~ ^simp-${PUPMOD_METADATA_VERSION}$|^${PUPMOD_METADATA_VERSION}$ ]]' -deploy: - - provider: puppetforge - user: simp - password: - secure: "weHKxY5HKhLO8et3b+wbEEmPbcUj4QLszARsD0f0Dlu9sPOi5/PthYmBpCaK8f8DZgNN7ejtBobAWqI5l+pXpD+PNswf37ZHbNORzp6QDXBOoS7wHg92jgxxY9tygmPbJ3zvWmIMP+iWktFIOwd8JSEDpYhhC0lYdxUbIJ4rb45M7OTc0k4ag/jwp7h1NZN2PCAWFwN4zkNxsEWmJVtmCKaMQMcT4V4frRnyPG97XJOiim9Wt6uKQiLAh4QCOwp/CcFvNRFR8N7flliurCrT6OwCmol4G9KTO4wmc1HNy7mIMZRDwqfEpHFN8w+2TTF4lVQ6jpjtq/RpgssR8TM+4K7e0nrfxpJF8CLVeUPzpYz6F9zCG8AHc2ix/z4Myj6KAG8ZNsNx9wmpaP29AmIULVbS6WcLNkXXux0+6ky2DXzQ+t1bSQVVwz6wnEa2+1k7QON5/b8PN1m8AmSP6ViEeAwHRCEJw7/Z/i/7YOtC4yEPfT+Q4fap2zRGH1ABkes3u3Od4BZEOGN1jeGVDBTji+cNanRgCFQCPWXzB9mb8RGT7ReXDRMs/kD5mkOxWErss//H7zZ6yRKD4PyYq5kjoDxBR+qYJn8ZGZYZSEgsTdSuXK6aO7/mxZGfduacvjkrBSNYlzRwaY6e2FnmeyenaPVTR60z3YEG2ce4UiTegTA=" - on: - tags: true + +addons: + apt: + packages: + - rpm + +before_install: + - rm -f Gemfile.lock + +jobs: + include: + - stage: check + rvm: 2.4.1 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5" + script: + - bundle exec rake check:dot_underscore + - bundle exec rake check:test_file + - bundle exec rake pkg:check_version + - bundle exec rake metadata_lint + - bundle exec rake pkg:compare_latest_tag + - bundle exec rake pkg:create_tag_changelog + - bundle exec rake lint + - bundle exec puppet module build + + - stage: spec + rvm: 2.4.1 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 5.0" + script: + - bundle exec rake spec + + - stage: spec + rvm: 2.1.9 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.10.0" + script: + - bundle exec rake spec + + - stage: spec rvm: 2.1.9 - condition: '($SKIP_FORGE_PUBLISH != true) && ($FORGE_PUBLISH = true)' - - provider: releases - api_key: - secure: "eyFFavsdZL3jceonFxIIQePil1JcYlUNVk5IyNEyq+CHjwf/TbijS9bk7t4OgDJTpuAvzZ1w3Nrotd0IN5dynpHfJlEpZdP37OjE0zmVULOWqMUTVsSpSW3B/R2VOMwQQHvsehpKZPL3Uhd5sTV5Ci7TfBAOZN0l6y5siF63w8jIIglBaqmlWCHoHZOmMpbm8g3QSYV1b6hPmSftKxOY03B8UVsl7ovfC7Of6HCt7cPr2hohK9v4ceuVL37ij1ajMj257+YCqss5gU5kn8K8F3L3dLHMG4RW/1OHaagYrdDz/U4yDjNGK742PHZiSg3Vp4y2eHdg1gAlHke/Tq2z8O5Ape1tC1coI+dOfuKFPdpqqQQ6WLb3COyEzE971gvyCi7lUL5xsoX94enmJ/mTBV5hjXFKSCBGfny90gNZ6DGMD7/dDGRHjT6q+f8bdaTBjfXkgoB/h/YdKcFJvvS2i/7I5wI5Z1hsk59h8sa7RbT/A2cUd+7uxVv9ATL0AIFk3gq0yFLdGQNfm6zjbmR+Kj9pVq4a/Fu2H1Fexoe58CAVIBgMi+I2SiFS9xDYBSRnH+H2XcU1n99aWKWi48MxvgUBLZMNtuBh1rkeDAn1OntmiObIKTfDM8QsxF0IztDYq8GWGulsrip2p3jGQZ1IlFNYLkfgt0WmS16Kf20079Q=" - skip_cleanup: true - on: - tags: true - condition: '($SKIP_FORGE_PUBLISH != true) && ($FORGE_PUBLISH = true)' + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.9.2" + script: + - bundle exec rake spec + + - stage: spec + rvm: 2.1.9 + env: STRICT_VARIABLES=yes TRUSTED_NODE_DATA=yes PUPPET_VERSION="~> 4.7.0" + script: + - bundle exec rake spec + + - stage: deploy + rvm: 2.4.1 + script: + - true + before_deploy: + - "export PUPMOD_METADATA_VERSION=`ruby -r json -e \"puts JSON.parse(File.read('metadata.json')).fetch('version')\"`" + - '[[ $TRAVIS_TAG =~ ^simp-${PUPMOD_METADATA_VERSION}$|^${PUPMOD_METADATA_VERSION}$ ]]' + + deploy: + - provider: releases + api_key: + secure: "eyFFavsdZL3jceonFxIIQePil1JcYlUNVk5IyNEyq+CHjwf/TbijS9bk7t4OgDJTpuAvzZ1w3Nrotd0IN5dynpHfJlEpZdP37OjE0zmVULOWqMUTVsSpSW3B/R2VOMwQQHvsehpKZPL3Uhd5sTV5Ci7TfBAOZN0l6y5siF63w8jIIglBaqmlWCHoHZOmMpbm8g3QSYV1b6hPmSftKxOY03B8UVsl7ovfC7Of6HCt7cPr2hohK9v4ceuVL37ij1ajMj257+YCqss5gU5kn8K8F3L3dLHMG4RW/1OHaagYrdDz/U4yDjNGK742PHZiSg3Vp4y2eHdg1gAlHke/Tq2z8O5Ape1tC1coI+dOfuKFPdpqqQQ6WLb3COyEzE971gvyCi7lUL5xsoX94enmJ/mTBV5hjXFKSCBGfny90gNZ6DGMD7/dDGRHjT6q+f8bdaTBjfXkgoB/h/YdKcFJvvS2i/7I5wI5Z1hsk59h8sa7RbT/A2cUd+7uxVv9ATL0AIFk3gq0yFLdGQNfm6zjbmR+Kj9pVq4a/Fu2H1Fexoe58CAVIBgMi+I2SiFS9xDYBSRnH+H2XcU1n99aWKWi48MxvgUBLZMNtuBh1rkeDAn1OntmiObIKTfDM8QsxF0IztDYq8GWGulsrip2p3jGQZ1IlFNYLkfgt0WmS16Kf20079Q=" + skip_cleanup: true + on: + tags: true + condition: '($SKIP_FORGE_PUBLISH != true)' + - provider: puppetforge + user: simp + password: + secure: "weHKxY5HKhLO8et3b+wbEEmPbcUj4QLszARsD0f0Dlu9sPOi5/PthYmBpCaK8f8DZgNN7ejtBobAWqI5l+pXpD+PNswf37ZHbNORzp6QDXBOoS7wHg92jgxxY9tygmPbJ3zvWmIMP+iWktFIOwd8JSEDpYhhC0lYdxUbIJ4rb45M7OTc0k4ag/jwp7h1NZN2PCAWFwN4zkNxsEWmJVtmCKaMQMcT4V4frRnyPG97XJOiim9Wt6uKQiLAh4QCOwp/CcFvNRFR8N7flliurCrT6OwCmol4G9KTO4wmc1HNy7mIMZRDwqfEpHFN8w+2TTF4lVQ6jpjtq/RpgssR8TM+4K7e0nrfxpJF8CLVeUPzpYz6F9zCG8AHc2ix/z4Myj6KAG8ZNsNx9wmpaP29AmIULVbS6WcLNkXXux0+6ky2DXzQ+t1bSQVVwz6wnEa2+1k7QON5/b8PN1m8AmSP6ViEeAwHRCEJw7/Z/i/7YOtC4yEPfT+Q4fap2zRGH1ABkes3u3Od4BZEOGN1jeGVDBTji+cNanRgCFQCPWXzB9mb8RGT7ReXDRMs/kD5mkOxWErss//H7zZ6yRKD4PyYq5kjoDxBR+qYJn8ZGZYZSEgsTdSuXK6aO7/mxZGfduacvjkrBSNYlzRwaY6e2FnmeyenaPVTR60z3YEG2ce4UiTegTA=" + on: + tags: true + condition: '($SKIP_FORGE_PUBLISH != true)' diff --git a/CHANGELOG b/CHANGELOG index 202f80c..cc6ea1f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +* Sat Mar 17 2018 Trevor Vaughan - 0.0.3-0 +- Added OEL and Puppet 5 support + * Thu Jul 06 2017 Liz Nemsick - 0.0.2-0 - Remove OBE pe dependency in metadata.json diff --git a/Gemfile b/Gemfile index cc07236..09b5459 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ group :test do gem 'puppet-lint-empty_string-check', :require => false gem 'puppet-lint-trailing_comma-check', :require => false gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 2.0') - gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 4.0') + gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', ['>= 5.2', '< 6.0']) end group :development do @@ -27,6 +27,7 @@ group :development do gem 'puppet-blacksmith' gem 'guard-rake' gem 'pry' + gem 'pry-byebug' gem 'pry-doc' # `listen` is a dependency of `guard` @@ -37,5 +38,5 @@ end group :system_tests do gem 'beaker' gem 'beaker-rspec' - gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 1.7') + gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 1.10') end diff --git a/build/rpm_metadata/requires b/build/rpm_metadata/requires deleted file mode 100644 index 8ba401c..0000000 --- a/build/rpm_metadata/requires +++ /dev/null @@ -1,4 +0,0 @@ -Requires: pupmod-puppetlabs-stdlib < 5.0.0-0 -Requires: pupmod-puppetlabs-stdlib >= 4.13.1-0 -Requires: pupmod-simp-simplib < 4.0.0-0 -Requires: pupmod-simp-simplib >= 3.1.0-0 diff --git a/metadata.json b/metadata.json index 6b25b57..f10e28c 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-chkrootkit", - "version": "0.0.2", + "version": "0.0.3", "author": "SIMP Team", "summary": "A SIMP puppet module for managing chkrootkit", "license": "Apache-2.0", @@ -34,12 +34,19 @@ "6", "7" ] + }, + { + "operatingsystem": "OracleLinux", + "operatingsystemrelease": [ + "6", + "7" + ] } ], "requirements": [ { "name": "puppet", - "version_requirement": ">= 4.7.0 < 5.0.0" + "version_requirement": ">= 4.7.0 < 6.0.0" } ], "data_provider": "hiera" diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml deleted file mode 100644 index 4f84d54..0000000 --- a/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,21 +0,0 @@ -HOSTS: - el7: - roles: - - server - - default - - master - platform: el-7-x86_64 - box: centos/7 - hypervisor: vagrant - el6: - roles: - - client - - agent - platform: el-6-x86_64 - box: centos/6 - hypervisor: vagrant -CONFIG: - log_level: verbose - type: aio - vagrant_memsize: 256 - ## vb_gui: true