diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 88093274..daceb642 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -245,15 +245,23 @@ with: BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker ``` +or + +```sh +BEAKER_PUPPET_COLLECTION=none BEAKER_setfile=archlinux-64 bundle exec rake beaker +``` + +This latter example will use the distribution's own version of Puppet. + You can replace the string `debian11` with any common operating system. The following strings are known to work: * ubuntu2004 * ubuntu2204 * debian11 -* centos7 -* centos8 +* debian12 * centos9 +* archlinux * almalinux8 * almalinux9 * fedora36 diff --git a/.github/labeler.yml b/.github/labeler.yml index 7899de84..f2d08d6b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,6 @@ --- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + skip-changelog: - head-branch: ['^release-*', 'release'] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..f5b5d7a9 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,42 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes + +changelog: + exclude: + labels: + - duplicate + - invalid + - modulesync + - question + - skip-changelog + - wont-fix + - wontfix + + categories: + - title: Breaking Changes 🛠 + labels: + - backwards-incompatible + + - title: New Features 🎉 + labels: + - enhancement + + - title: Bug Fixes 🐛 + labels: + - bug + + - title: Documentation Updates 📚 + labels: + - documentation + - docs + + - title: Dependency Updates ⬆️ + labels: + - dependencies + + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..66127cd0 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,17 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: "Pull Request Labeler" + +on: + pull_request_target: {} + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55324aa6..93b33c2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,3 +20,10 @@ jobs: # https://docs.github.com/en/actions/security-guides/encrypted-secrets username: ${{ secrets.PUPPET_FORGE_USERNAME }} api_key: ${{ secrets.PUPPET_FORGE_API_KEY }} + + create-github-release: + name: Create GitHub Release + runs-on: ubuntu-latest + steps: + - name: Create GitHub release + uses: voxpupuli/gha-create-a-github-release@v1 diff --git a/.msync.yml b/.msync.yml index 36071685..95e8c977 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '9.0.0' +modulesync_config_version: '9.1.0' diff --git a/.puppet-lint.rc b/.puppet-lint.rc index dd8272c7..05d28a26 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,3 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + --fail-on-warnings --no-parameter_documentation-check --no-parameter_types-check diff --git a/Gemfile b/Gemfile index 27cdc0de..7123c663 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 8.0', :require => false + gem 'voxpupuli-test', '~> 9.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 4.0', :require => false diff --git a/spec/classes/php_fpm_service_spec.rb b/spec/classes/php_fpm_service_spec.rb index a364a9f0..39df3cee 100644 --- a/spec/classes/php_fpm_service_spec.rb +++ b/spec/classes/php_fpm_service_spec.rb @@ -27,9 +27,9 @@ end describe 'when called with no parameters' do - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' - case facts[:operatingsystemrelease] + case facts[:os]['release']['major'] when '18.04' it { is_expected.to contain_service('php7.2-fpm').with_ensure('running') } when '22.04' diff --git a/spec/classes/php_fpm_spec.rb b/spec/classes/php_fpm_spec.rb index 7df13cf4..04d13e43 100644 --- a/spec/classes/php_fpm_spec.rb +++ b/spec/classes/php_fpm_spec.rb @@ -16,9 +16,9 @@ describe 'when called with no parameters' do # rubocop:disable RSpec/RepeatedExample - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' - case facts[:operatingsystemrelease] + case facts[:os]['release']['major'] when '18.04' it { is_expected.to contain_package('php7.2-fpm').with_ensure('present') } it { is_expected.to contain_service('php7.2-fpm').with_ensure('running') } diff --git a/spec/classes/php_repo_spec.rb b/spec/classes/php_repo_spec.rb index 55faf500..2f14098d 100644 --- a/spec/classes/php_repo_spec.rb +++ b/spec/classes/php_repo_spec.rb @@ -22,9 +22,9 @@ end describe 'when configuring a package repo' do - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' - case facts[:operatingsystem] + case facts[:os]['name'] when 'Debian' it { is_expected.to contain_class('php::repo::debian') } when 'Ubuntu' diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb index ce687b10..4dfed58f 100644 --- a/spec/classes/php_spec.rb +++ b/spec/classes/php_spec.rb @@ -86,12 +86,12 @@ end describe 'when called with no parameters' do - case facts[:osfamily] + case facts[:os]['family'] when 'Suse', 'RedHat', 'CentOS' it { is_expected.to contain_class('php::global') } end - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.not_to contain_class('php::global') } it { is_expected.to contain_class('php::fpm') } @@ -125,7 +125,7 @@ it { is_expected.to contain_php__extension('xml').with_ensure('absent') } - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.to contain_package(php_cli_package).with_ensure('absent') } it { is_expected.to contain_package(php_fpm_package).with_ensure('absent') } @@ -143,17 +143,17 @@ package_prefix = 'myphp-' let(:params) { { package_prefix: package_prefix } } - case facts[:osfamily] + case facts[:os]['family'] when 'Suse', 'RedHat', 'CentOS' it { is_expected.to contain_class('php::global') } end - case facts[:osfamily] + case facts[:os]['family'] when 'Debian', 'RedHat', 'CentOS' it { is_expected.to contain_package("#{package_prefix}cli").with_ensure('present') } end - case facts[:osfamily] + case facts[:os]['family'] when 'Debian' it { is_expected.not_to contain_class('php::global') } it { is_expected.to contain_class('php::fpm') } @@ -179,7 +179,7 @@ it { is_expected.to contain_class('php::fpm').with(user: 'nginx') } it { is_expected.to contain_php__fpm__pool('www').with(user: 'nginx') } - dstfile = case facts[:osfamily] + dstfile = case facts[:os]['family'] when 'Debian' case facts[:os]['name'] when 'Debian' @@ -224,7 +224,7 @@ it { is_expected.to contain_class('php::fpm').with(group: 'nginx') } it { is_expected.to contain_php__fpm__pool('www').with(group: 'nginx') } - dstfile = case facts[:osfamily] + dstfile = case facts[:os]['family'] when 'Debian' case facts[:os]['name'] when 'Debian' @@ -276,7 +276,7 @@ it { is_expected.to contain_php__fpm__pool('www').with(apparmor_hat: 'www') } - dstfile = case facts[:osfamily] + dstfile = case facts[:os]['family'] when 'Debian' case facts[:os]['name'] when 'Debian' @@ -327,7 +327,7 @@ it { is_expected.not_to contain_class('php::composer') } end - if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' || facts[:os]['name'] == 'Ubuntu' || (facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i < 12) + if facts[:os]['family'] == 'RedHat' || facts[:os]['family'] == 'CentOS' || facts[:os]['name'] == 'Ubuntu' || (facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i < 12) describe 'when called with flavor zend' do zendphp_cli_package = case facts[:os]['name'] when 'Debian', 'Ubuntu' @@ -355,7 +355,7 @@ end end - if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' + if facts[:os]['family'] == 'RedHat' || facts[:os]['family'] == 'CentOS' describe 'when called with valid settings parameter types' do let(:params) do { diff --git a/spec/defines/extension_rhscl_spec.rb b/spec/defines/extension_rhscl_spec.rb index 197ef173..7fdfc95d 100644 --- a/spec/defines/extension_rhscl_spec.rb +++ b/spec/defines/extension_rhscl_spec.rb @@ -4,7 +4,7 @@ describe 'php::extension' do on_supported_os.each do |os, facts| - next unless facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS' + next unless facts[:os]['family'] == 'RedHat' || facts[:os]['family'] == 'CentOS' context "on #{os}" do let :facts do diff --git a/spec/defines/extension_spec.rb b/spec/defines/extension_spec.rb index 3668ff4f..28ecf6d1 100644 --- a/spec/defines/extension_spec.rb +++ b/spec/defines/extension_spec.rb @@ -10,7 +10,7 @@ end let(:pre_condition) { 'include php' } - unless facts[:osfamily] == 'Suse' || facts[:osfamily] == 'FreeBSD' # FIXME: something is wrong on these + unless facts[:os]['family'] == 'Suse' || facts[:os]['family'] == 'FreeBSD' # FIXME: something is wrong on these etcdir = case facts[:os]['name'] when 'Debian' case facts[:os]['release']['major'] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9efb4ae6..58c9b66a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,10 @@ require 'voxpupuli/test/spec_helper' +RSpec.configure do |c| + c.facterdb_string_keys = false +end + add_mocked_facts! if File.exist?(File.join(__dir__, 'default_module_facts.yml'))