From 71676c18d2a6ef3dcfe23f961f9a34db8e37f164 Mon Sep 17 00:00:00 2001 From: Tobias Wolter Date: Mon, 28 Dec 2020 18:02:21 +0100 Subject: [PATCH 1/4] Remove Support for Debian Jessie Debian Jessie is EOL as of 2020-06-30, and the support is blocking tests further downstream, thus we remove the support for it. --- README.md | 5 ----- REFERENCE.md | 33 ++++++++++++++------------------- manifests/init.pp | 27 +++++++++++---------------- manifests/params.pp | 14 +------------- metadata.json | 1 - spec/spec_helper_acceptance.rb | 7 ------- 6 files changed, 26 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 1ad1fb14..c39be161 100644 --- a/README.md +++ b/README.md @@ -542,11 +542,6 @@ In Puppet < 4.0, you also need the resources to notify their `cs_commit`: Cs_primitive['pgsql_service'] ~> Cs_commit['puppet'] ``` -### Dependencies - -Tested and built on Debian 6 using backports so version 1.4.2 of Corosync is validated -to function. - ## Notes ### Upstream documentation diff --git a/REFERENCE.md b/REFERENCE.md index bd4335ed..5386a035 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -23,18 +23,18 @@ * [`cs_location`](#cs_location): Type for manipulating corosync/pacemaker resource location. More information on Corosync/Pacemaker colocation can be found here: * http://ww * [`cs_order`](#cs_order): Type for manipulating Corosync/Pacemkaer ordering entries. Order entries are another type of constraint that can be put on sets of primitive * [`cs_primitive`](#cs_primitive): Type for manipulating Corosync/Pacemaker primitives. Primitives are probably the most important building block when creating highly availabl -* [`cs_property`](#cs_property): Type for manipulating corosync/pacemaker configuration properties. Besides the configuration file that is managed by the module the contains +* [`cs_property`](#cs_property): Type for manipulating corosync/pacemaker configuration properties. Besides the configuration file that is managed by the module the contains * [`cs_rsc_defaults`](#cs_rsc_defaults): Type for manipulating corosync/pacemaker global defaults for resource options. The type is pretty simple interface for setting key/value pair -* [`cs_shadow`](#cs_shadow): cs_shadow resources represent a Corosync shadow CIB. Any corosync resources defined with 'cib' set to the title of a cs_shadow resource will +* [`cs_shadow`](#cs_shadow): cs_shadow resources represent a Corosync shadow CIB. Any corosync resources defined with 'cib' set to the title of a cs_shadow resource will **Data types** -* [`Corosync::ArrayRing`](#corosyncarrayring): +* [`Corosync::ArrayRing`](#corosyncarrayring): * [`Corosync::CryptoCipher`](#corosynccryptocipher): Defines the allowed cipher types for secure corosync communication -* [`Corosync::CryptoHash`](#corosynccryptohash): -* [`Corosync::IpStringIp`](#corosyncipstringip): -* [`Corosync::QuorumAlgorithm`](#corosyncquorumalgorithm): -* [`Corosync::Syslogpriority`](#corosyncsyslogpriority): +* [`Corosync::CryptoHash`](#corosynccryptohash): +* [`Corosync::IpStringIp`](#corosyncipstringip): +* [`Corosync::QuorumAlgorithm`](#corosyncquorumalgorithm): +* [`Corosync::Syslogpriority`](#corosyncsyslogpriority): ## Classes @@ -293,8 +293,8 @@ Default value: $corosync::params::package_corosync Data type: `Boolean` Define if package crmsh should be managed. -Default (Debian based): true -Default (otherwise): false +Default (Debian): true +Default: false Default value: $corosync::params::package_crmsh @@ -331,8 +331,7 @@ Default value: $corosync::params::package_fence_agents Data type: `Optional[Array[String[1]]]` Additional install-options for the corosync package resource. -Default (Debian Jessie): ['-t', 'jessie-backports'] -Default (otherwise): undef +Default: undef Default value: $corosync::params::package_install_options @@ -341,8 +340,7 @@ Default value: $corosync::params::package_install_options Data type: `Optional[Array[String[1]]]` Additional install-options for the crmsh package resource. -Default (Debian Jessie): ['-t', 'jessie-backports'] -Default (otherwise): undef +Default: undef Default value: $corosync::params::package_install_options @@ -351,8 +349,7 @@ Default value: $corosync::params::package_install_options Data type: `Optional[Array[String[1]]]` Additional install-options for the pacemaker package resource. -Default (Debian Jessie): ['-t', 'jessie-backports'] -Default (otherwise): undef +Default: undef Default value: $corosync::params::package_install_options @@ -361,8 +358,7 @@ Default value: $corosync::params::package_install_options Data type: `Optional[Array[String[1]]]` Additional install-options for the pcs package resource. -Default (Debian Jessie): ['-t', 'jessie-backports'] -Default (otherwise): undef +Default: undef Default value: $corosync::params::package_install_options @@ -371,8 +367,7 @@ Default value: $corosync::params::package_install_options Data type: `Optional[Array[String[1]]]` Additional install-options for the pcs package resource. -Default (Debian Jessie): ['-t', 'jessie-backports'] -Default (otherwise): undef +Default: undef Default value: $corosync::params::package_install_options diff --git a/manifests/init.pp b/manifests/init.pp index 8fc0e6d7..b3539239 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -105,16 +105,16 @@ # # @param package_crmsh # Define if package crmsh should be managed. -# Default (Debian based): true -# Default (otherwise): false +# Default (Debian): true +# Default: false # # @param package_pacemaker # Define if package pacemaker should be managed. # # @param package_pcs # Define if package pcs should be managed. -# Default (Red Hat based): true -# Default (otherwise): false +# Default (Debian): false +# Default: true # # @param package_fence_agents # Define if package fence-agents should be managed. @@ -123,28 +123,23 @@ # # @param packageopts_corosync # Additional install-options for the corosync package resource. -# Default (Debian Jessie): ['-t', 'jessie-backports'] -# Default (otherwise): undef +# Default: undef # # @param packageopts_crmsh # Additional install-options for the crmsh package resource. -# Default (Debian Jessie): ['-t', 'jessie-backports'] -# Default (otherwise): undef +# Default: undef # # @param packageopts_pacemaker # Additional install-options for the pacemaker package resource. -# Default (Debian Jessie): ['-t', 'jessie-backports'] -# Default (otherwise): undef +# Default: undef # # @param packageopts_pcs # Additional install-options for the pcs package resource. -# Default (Debian Jessie): ['-t', 'jessie-backports'] -# Default (otherwise): undef +# Default: undef # # @param packageopts_fence_agents # Additional install-options for the pcs package resource. -# Default (Debian Jessie): ['-t', 'jessie-backports'] -# Default (otherwise): undef +# Default: undef # # @param version_corosync # Define what version of the corosync package should be installed. @@ -292,10 +287,10 @@ # consensus value. # # @param ip_version -# This specifies version of IP to ask DNS resolver for. The value can be +# This specifies version of IP to ask DNS resolver for. The value can be # one of ipv4 (look only for an IPv4 address) , ipv6 (check only IPv6 address), # ipv4-6 (look for all address families and use first IPv4 address found in the -# list if there is such address, otherwise use first IPv6 address) and +# list if there is such address, otherwise use first IPv6 address) and # ipv6-4 (look for all address families and use first IPv6 address found in the # list if there is such address, otherwise use first IPv4 address). # diff --git a/manifests/params.pp b/manifests/params.pp index 1dad627f..1b61a05a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -41,19 +41,7 @@ $package_crmsh = true $package_pcs = false $package_fence_agents = false - - case $facts['os']['name'] { - 'Debian': { - if versioncmp($facts['os']['release']['full'], '8') == 0 { - $package_install_options = ['-t', 'jessie-backports'] - } else { - $package_install_options = undef - } - } - default : { - $package_install_options = undef - } - } + $package_install_options = undef } default: { diff --git a/metadata.json b/metadata.json index 3c301ece..50d5bd46 100644 --- a/metadata.json +++ b/metadata.json @@ -23,7 +23,6 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "8", "9" ] }, diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 13d06829..91bb4c1c 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,13 +1,6 @@ require 'voxpupuli/acceptance/spec_helper_acceptance' configure_beaker do |host| - # For Debian 8 "jessie", we need - # - pacemaker and crmsh delivered in jessie-backports only - # - openhpid post-install may fail (https://bugs.debian.org/785287) - if fact_on(host, 'os.family') == 'Debian' && fact_on(host, 'os.release.major') == '8' - on host, 'echo deb http://ftp.debian.org/debian jessie-backports main >> /etc/apt/sources.list' - on host, 'apt-get update && apt-get install -y openhpid', acceptable_exit_codes: [0, 1, 100] - end # On Debian-based, service state transitions (restart, stop) hang indefinitely and # lead to test timeouts if there is a service unit of Type=notify involved. # Use Type=simple as a workaround. See issue 455. From 981fcc269f972ff13945495062e525735cb9284e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 25 Nov 2020 17:07:29 +0100 Subject: [PATCH 2/4] modulesync 4.0.0 --- .github/CONTRIBUTING.md | 5 +-- .github/workflows/ci.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 29 ++++++++++++++ .msync.yml | 2 +- .pmtignore | 17 +++++++- .travis.yml | 73 ---------------------------------- Gemfile | 27 +++---------- Rakefile | 9 ++++- 8 files changed, 136 insertions(+), 101 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cace33e6..f1f88ccf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -232,14 +232,14 @@ simple tests against it after applying the module. You can run this with: ```sh -bundle exec rake acceptance +bundle exec rake beaker ``` This will run the tests on the module's default nodeset. You can override the nodeset used, e.g., ```sh -BEAKER_set=centos-7-x64 bundle exec rake acceptance +BEAKER_set=centos-7-x64 bundle exec rake beaker ``` There are default rake tasks for the various acceptance test modules, e.g., @@ -269,7 +269,6 @@ The following strings are known to work: * ubuntu2004 * debian9 * debian10 -* centos6 * centos7 * centos8 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..b4f47e87 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: pull_request + +jobs: + setup_matrix: + name: 'Setup Test Matrix' + runs-on: ubuntu-latest + 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 }} + env: + BUNDLE_WITHOUT: development:test:release + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - name: Run rake validate + run: bundle exec rake validate + - name: Setup Test Matrix + id: get-outputs + run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false + + unit: + needs: setup_matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} + env: + BUNDLE_WITHOUT: development:system_tests:release + PUPPET_VERSION: "~> ${{ matrix.puppet }}.0" + name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run tests + run: bundle exec rake + + acceptance: + needs: setup_matrix + runs-on: ubuntu-latest + env: + BUNDLE_WITHOUT: development:test:release + strategy: + fail-fast: false + matrix: + setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} + puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} + name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} + steps: + - name: Enable IPv6 on docker + run: | + echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json + sudo service docker restart + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - name: Run tests + run: bundle exec rake beaker + env: + BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} + BEAKER_setfile: ${{ matrix.setfile.value }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..68b85284 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - '*' + +env: + BUNDLE_WITHOUT: development:test:system_tests + +jobs: + deploy: + name: 'deploy to forge' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + - name: Build and Deploy + env: + # Configure secrets here: + # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets + BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}' + BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}' + run: bundle exec rake module:push diff --git a/.msync.yml b/.msync.yml index 5758aced..a0770a83 100644 --- a/.msync.yml +++ b/.msync.yml @@ -1,2 +1,2 @@ --- -modulesync_config_version: '3.1.0' +modulesync_config_version: '4.0.0' diff --git a/.pmtignore b/.pmtignore index 4e6d54b8..33a8c65d 100644 --- a/.pmtignore +++ b/.pmtignore @@ -1,11 +1,12 @@ docs/ pkg/ +Gemfile Gemfile.lock Gemfile.local vendor/ .vendor/ -spec/fixtures/manifests/ -spec/fixtures/modules/ +spec/ +Rakefile .vagrant/ .bundle/ .ruby-version @@ -13,9 +14,21 @@ coverage/ log/ .idea/ .dependencies/ +.github/ .librarian/ Puppetfile.lock *.iml +.editorconfig +.fixtures.yml +.gitignore +.msync.yml +.overcommit.yml +.pmtignore +.rspec +.rspec_parallel +.rubocop.yml +.sync.yml .*.sw? .yardoc/ +.yardopts Dockerfile diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82599859..00000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -# yamllint disable rule:line-length rule:truthy -os: linux -dist: focal -language: ruby -cache: bundler -before_install: - - yes | gem update --system - - bundle --version -script: - - 'bundle exec rake $CHECK' -jobs: - fast_finish: true - include: - - rvm: 2.4.4 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 5.0" CHECK=test - - rvm: 2.5.3 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls - - rvm: 2.5.3 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 6.0" CHECK=rubocop - - rvm: 2.4.4 - bundler_args: --without system_tests development release - env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=centos7-64 CHECK=beaker - services: docker - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=centos7-64 CHECK=beaker - services: docker - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian9-64 CHECK=beaker - services: docker - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian9-64 CHECK=beaker - services: docker - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=ubuntu1604-64 CHECK=beaker - services: docker - - rvm: 2.5.3 - bundler_args: --without development release - env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1604-64 CHECK=beaker - services: docker -branches: - only: - - master - - /^v\d/ -notifications: - email: false - webhooks: https://voxpupu.li/incoming/travis - irc: - on_success: always - on_failure: always - channels: - - "chat.freenode.org#voxpupuli-notifications" -deploy: - provider: puppetforge - username: puppet - password: - secure: "OKYO+/kY1KB9EH0pB30AU6E2c5SZbNql+Klg+sb1/LMi+ADjyNEzcfTP6aUhnYedKJf5m8rfycc81UPuUeKaR/U/mPwR1R5OKh+S1KL1yzrRdxdpmLWMX14nBFbAZYvSTe/bPbxhngjW84uHRF2zkkSxKStsIzyy2DcTYayaWZ0=" - on: - tags: true - # all_branches is required to use tags - all_branches: true - # Only publish the build marked with "DEPLOY_TO_FORGE" - condition: "$DEPLOY_TO_FORGE = yes" diff --git a/Gemfile b/Gemfile index 2fce93ce..0d0a9fb2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,15 +1,5 @@ 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 :test do gem 'voxpupuli-test', '~> 2.1', :require => false gem 'coveralls', :require => false @@ -17,14 +7,13 @@ group :test do end group :development do - gem 'travis', :require => false - gem 'travis-lint', :require => false gem 'guard-rake', :require => false gem 'overcommit', '>= 0.39.1', :require => false end group :system_tests do - gem 'voxpupuli-acceptance', :require => false + gem 'puppet_metadata', '~> 0.3.0', :require => false + gem 'voxpupuli-acceptance', :require => false end group :release do @@ -34,15 +23,11 @@ group :release do 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] - -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion.to_s, :require => false, :groups => [:test] -else - gem 'facter', :require => false, :groups => [:test] -end - -ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s +puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0' gem 'puppet', puppetversion, :require => false, :groups => [:test] # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index b450fe7b..d1bf7491 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,10 @@ -require 'voxpupuli/test/rake' +# 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' +end # load optional tasks for releases # only available if gem group releases is installed @@ -26,6 +32,7 @@ end 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+$/ From 670d6ae583ff18d6783b2e299625abee598fe764 Mon Sep 17 00:00:00 2001 From: Tobias Wolter Date: Mon, 28 Dec 2020 17:14:15 +0100 Subject: [PATCH 3/4] Unwrap sensitive strings The new Sensitive strings needed some unwrapping to be actually digestible. --- manifests/init.pp | 2 +- manifests/qdevice.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index b3539239..c265c649 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -453,7 +453,7 @@ user { 'hacluster': ensure => 'present', gid => 'haclient', - password => $sensitive_hacluster_hash, + password => $sensitive_hacluster_hash.unwrap, } } } diff --git a/manifests/qdevice.pp b/manifests/qdevice.pp index ae93505a..4572e373 100644 --- a/manifests/qdevice.pp +++ b/manifests/qdevice.pp @@ -73,7 +73,7 @@ # Cluster admin credentials user { $cluster_user: ensure => 'present', - password => $sensitive_hacluster_hash, + password => $sensitive_hacluster_hash.unwrap, gid => $cluster_group, } From adcc42d85c8fbb165570012303533f9275834e8f Mon Sep 17 00:00:00 2001 From: Tobias Wolter Date: Tue, 29 Dec 2020 00:42:10 +0100 Subject: [PATCH 4/4] Link to correct CONTRIBUTING.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c39be161..6567195f 100644 --- a/README.md +++ b/README.md @@ -571,7 +571,7 @@ continue the development of this module. ## Development -See the [contributing guide](CONTRIBUTING.md) for details. Additionally, some general guidelines on PR structure can be found [here](https://voxpupuli.org/docs/#reviewing-a-module-pr). +See the [contributing guide](.github/CONTRIBUTING.md) for details. Additionally, some general guidelines on PR structure can be found [here](https://voxpupuli.org/docs/#reviewing-a-module-pr). ## Copyright and License