diff --git a/.editorconfig b/.editorconfig index d77700e..ecb10a8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,7 @@ # editorconfig.org -# MANAGED BY MODULESYNC +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ root = true diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 887d571..048d2b5 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -25,7 +25,7 @@ By participating in this project you agree to abide by its terms. * Fork the repo. * Create a separate branch for your change. -* We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org) runs the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix). +* We only take pull requests with passing tests, and documentation. [GitHub Actions](https://docs.github.com/en/actions) run the tests for us. You can also execute them locally. This is explained [in a later section](#the-test-matrix). * Checkout [our docs](https://voxpupuli.org/docs/reviewing_pr/) we use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html). They provide some guidance for new code that might help you before you submit a pull request. * Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test. * Squash your commits down into logical components. Make sure to rebase against our current master. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97ddc62..2ce5b05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + name: CI on: pull_request @@ -8,20 +12,19 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 40 outputs: - beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }} - puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }} puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }} + github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }} env: - BUNDLE_WITHOUT: development:release + BUNDLE_WITHOUT: development:system_tests:release steps: - uses: actions/checkout@v2 - name: Setup ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' bundler-cache: true - - name: Run rake validate - run: bundle exec rake validate + - name: Run static validations + run: bundle exec rake validate lint check - name: Run rake rubocop run: bundle exec rake rubocop - name: Setup Test Matrix @@ -48,7 +51,7 @@ jobs: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run tests - run: bundle exec rake + run: bundle exec rake parallel_spec acceptance: needs: setup_matrix @@ -58,18 +61,26 @@ jobs: strategy: fail-fast: false matrix: - setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} - puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} + include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}} name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} steps: - uses: actions/checkout@v2 - name: Setup ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' bundler-cache: true - name: Run tests run: bundle exec rake beaker env: BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} BEAKER_setfile: ${{ matrix.setfile.value }} + + tests: + needs: + - unit + - acceptance + runs-on: ubuntu-latest + name: Test suite + steps: + - run: echo Test suite completed diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68b8528..664ba69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,7 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + name: Release on: @@ -12,6 +16,7 @@ jobs: deploy: name: 'deploy to forge' runs-on: ubuntu-latest + if: github.repository_owner == 'voxpupuli' steps: - name: Checkout repository uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index e9b3cf4..9b95224 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + pkg/ Gemfile.lock Gemfile.local diff --git a/.msync.yml b/.msync.yml index 57ff503..43966c2 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1,2 +1,5 @@ --- -modulesync_config_version: '4.1.0' +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +modulesync_config_version: '4.2.0' diff --git a/.overcommit.yml b/.overcommit.yml index 0af0fdc..d367ada 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -1,4 +1,5 @@ -# Managed by https://github.com/voxpupuli/modulesync_configs +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # # Hooks are only enabled if you take action. # diff --git a/.pmtignore b/.pmtignore index 33a8c65..65f5051 100644 --- a/.pmtignore +++ b/.pmtignore @@ -1,3 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + docs/ pkg/ Gemfile diff --git a/.rspec b/.rspec index 8c18f1a..f634583 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,5 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --format documentation --color diff --git a/.rspec_parallel b/.rspec_parallel index e4d136b..a9a84f8 100644 --- a/.rspec_parallel +++ b/.rspec_parallel @@ -1 +1,4 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --format progress diff --git a/.rubocop.yml b/.rubocop.yml index 198a359..53ac189 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,6 @@ --- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + inherit_gem: voxpupuli-test: rubocop.yml diff --git a/.yardopts b/.yardopts deleted file mode 100644 index 3687f51..0000000 --- a/.yardopts +++ /dev/null @@ -1,2 +0,0 @@ ---markup markdown ---output-dir docs/ diff --git a/Dockerfile b/Dockerfile index a51c641..e3cf307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# MANAGED BY MODULESYNC +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + FROM ruby:2.7 WORKDIR /opt/puppet diff --git a/Gemfile b/Gemfile index f4855f6..a39114c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,13 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + source ENV['GEM_SOURCE'] || "https://rubygems.org" group :test do - gem 'voxpupuli-test', '~> 2.1', :require => false - gem 'coveralls', :require => false - gem 'simplecov-console', :require => false + gem 'voxpupuli-test', '~> 2.5', :require => false + gem 'coveralls', :require => false + gem 'simplecov-console', :require => false + gem 'puppet_metadata', '~> 1.0', :require => false end group :development do @@ -12,22 +16,19 @@ group :development do end group :system_tests do - gem 'puppet_metadata', '~> 0.3.0', :require => false - gem 'voxpupuli-acceptance', :require => false + gem 'voxpupuli-acceptance', '~> 1.0', :require => false end group :release do - gem 'github_changelog_generator', '>= 1.16.1', :require => false - gem 'puppet-blacksmith', :require => false - gem 'voxpupuli-release', :require => false + gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' + gem 'voxpupuli-release', '>= 1.0.2', :require => false gem 'puppet-strings', '>= 2.2', :require => false end -gem 'puppetlabs_spec_helper', '~> 2.0', :require => false gem 'rake', :require => false gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test] -puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0' +puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0' gem 'puppet', puppetversion, :require => false, :groups => [:test] # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index d1bf749..80b799d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,22 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + # Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper), # otherwise attempt to load it directly. begin require 'voxpupuli/test/rake' rescue LoadError - require 'puppetlabs_spec_helper/rake_tasks' + begin + require 'puppetlabs_spec_helper/rake_tasks' + rescue LoadError + end +end + +# load optional tasks for acceptance +# only available if gem group releases is installed +begin + require 'voxpupuli/acceptance/rake' +rescue LoadError end # load optional tasks for releases @@ -34,14 +47,12 @@ begin require 'github_changelog_generator/task' require 'puppet_blacksmith' GitHubChangelogGenerator::RakeTask.new :changelog do |config| - version = (Blacksmith::Modulefile.new).version - config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ + metadata = Blacksmith::Modulefile.new + config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/ config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} config.user = 'voxpupuli' - metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') - metadata = JSON.load(File.read(metadata_json)) - config.project = metadata['name'] + config.project = metadata.metadata['name'] end # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 diff --git a/manifests/params.pp b/manifests/params.pp index f2331ee..8e76472 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -26,7 +26,7 @@ $nrpe_service = 'nagios-nrpe-server' $nrpe_packages = [ 'nagios-nrpe-server', - 'nagios-plugins', + 'monitoring-plugins', ] } 'Solaris': { diff --git a/metadata.json b/metadata.json index bff04f7..a320930 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.25.1 < 8.0.0" + "version_requirement": ">= 4.25.1 < 9.0.0" } ], "requirements": [ @@ -51,13 +51,15 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "8" + "10", + "11" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "16.04" + "18.04", + "20.04" ] }, { diff --git a/spec/classes/nrpe_install_spec.rb b/spec/classes/nrpe_install_spec.rb index c175ac8..e9615cf 100644 --- a/spec/classes/nrpe_install_spec.rb +++ b/spec/classes/nrpe_install_spec.rb @@ -13,7 +13,7 @@ case facts[:osfamily] when 'Debian' it { is_expected.to contain_package('nagios-nrpe-server').with_ensure('installed') } - it { is_expected.to contain_package('nagios-plugins').with_ensure('installed') } + it { is_expected.to contain_package('monitoring-plugins').with_ensure('installed') } when 'Gentoo' it { is_expected.to contain_package('net-analyzer/nrpe').with_ensure('installed') } it { is_expected.to contain_package('net-analyzer/nagios-plugins').with_ensure('installed') } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d266f6b..fb5f0cb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,5 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # puppetlabs_spec_helper will set up coverage if the env variable is set. # We want to do this if lib exists and it hasn't been explicitly set.