Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modulesync 9.1.0 #229

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -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']
42 changes: 42 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -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:
- "*"
17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 3 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
spec/spec_helper_acceptance.rb:
unmanaged: false
spec/spec_helper.rb:
facterdb_string_keys: true
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions spec/classes/defaults_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
let(:pre_condition) { 'class { "logrotate": }' }

context 'no osfamily' do
let(:facts) { { os: { family: 'fake' } } }
let(:facts) { { 'os' => { 'family' => 'fake' } } }

it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf')
}
end

on_supported_os.each do |os, facts|
context os, if: facts[:osfamily] == 'Debian' do
let(:facts) { facts }
on_supported_os.each do |os, os_facts|
context os, if: os_facts['os']['family'] == 'Debian' do
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

if facts[:operatingsystem] == 'Ubuntu'
if os_facts['os']['name'] == 'Ubuntu'
it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf').with(
'su_user' => 'root',
Expand Down Expand Up @@ -56,8 +56,8 @@
}
end

context os, if: facts[:osfamily] == 'RedHat' do
let(:facts) { facts }
context os, if: os_facts['os']['family'] == 'RedHat' do
let(:facts) { os_facts }

it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf')
Expand All @@ -67,7 +67,7 @@
is_expected.to contain_logrotate__rule('wtmp').with(
'path' => '/var/log/wtmp',
'create_mode' => '0664',
'missingok' => facts[:operatingsystemmajrelease].to_i >= 8,
'missingok' => facts['os']['release']['major'].to_i >= 8,
'minsize' => '1M',
'create' => true,
'create_owner' => 'root',
Expand All @@ -91,7 +91,7 @@
}
end

context os, if: facts[:osfamily] == 'Suse' do
context os, if: os_facts['os']['family'] == 'Suse' do
it {
is_expected.to contain_logrotate__conf('/etc/logrotate.conf')
}
Expand All @@ -113,8 +113,8 @@
}
end

context os, if: facts[:osfamily] == 'FreeBSD' do
let(:facts) { facts }
context os, if: os_facts['os']['family'] == 'FreeBSD' do
let(:facts) { os_facts }

it {
is_expected.to contain_logrotate__conf('/usr/local/etc/logrotate.conf')
Expand Down
14 changes: 7 additions & 7 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

describe 'logrotate' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) do
facts
os_facts
end

context 'logrotate class without any parameters' do
Expand All @@ -18,7 +18,7 @@
it { is_expected.to contain_class("logrotate::#{classs}") }
end

case facts[:operatingsystem]
case os_facts['os']['name']
when 'FreeBSD'
it do
is_expected.to contain_file('/usr/local/etc/logrotate.d/hourly').with(
Expand Down Expand Up @@ -52,7 +52,7 @@
is_expected.to contain_class('logrotate::defaults')
end

if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i >= 9
if os_facts['os']['family'] == 'RedHat' && os_facts['os']['release']['major'].to_i >= 9
it do
is_expected.to contain_service('logrotate.timer').with(
'ensure' => 'running',
Expand Down Expand Up @@ -142,7 +142,7 @@
context 'logrotate class with purge_configdir set to true' do
let(:params) { { purge_configdir: true } }

case facts[:operatingsystem]
case os_facts['os']['name']
when 'FreeBSD'
it do
is_expected.to contain_file('/usr/local/etc/logrotate.d').with('ensure' => 'directory',
Expand Down Expand Up @@ -176,7 +176,7 @@
context 'with config => { prerotate => "/usr/bin/test", rotate_every => "daily" }' do
let(:params) { { config: { prerotate: '/usr/bin/test', rotate_every: 'daily' } } }

case facts[:operatingsystem]
case os_facts['os']['name']
when 'FreeBSD'
it {
is_expected.to contain_logrotate__conf('/usr/local/etc/logrotate.conf').
Expand All @@ -195,7 +195,7 @@
context 'with ensure => absent' do
let(:params) { { ensure_cron_hourly: 'absent' } }

case facts[:operatingsystem]
case os_facts['os']['name']
when 'FreeBSD'
it { is_expected.to contain_file('/usr/local/etc/logrotate.d/hourly').with_ensure('directory') }
else
Expand Down
10 changes: 5 additions & 5 deletions spec/defines/cron_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
context 'supported operating systems' do
let(:pre_condition) { 'class { "logrotate": }' }

on_supported_os.each do |os, facts|
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) do
facts
os_facts
end

context 'With default params' do
let(:title) { 'test' }
let(:params) { { ensure: 'present' } }

if facts[:osfamily] == 'FreeBSD'
if os_facts['os']['family'] == 'FreeBSD'
it {
is_expected.to contain_file('/usr/local/bin/logrotate.test.sh').
with_ensure('present').
Expand All @@ -36,7 +36,7 @@
let(:title) { 'test' }
let(:params) { { ensure: 'present' } }

if facts[:osfamily] == 'FreeBSD'
if os_facts['os']['family'] == 'FreeBSD'
it {
is_expected.to contain_file('/usr/local/bin/logrotate.test.sh').
with_ensure('present').
Expand All @@ -56,7 +56,7 @@
# Test FreeBSD separately as it is only partially supported by the module and not in the list of supported os.
# When FreeBSD is added to the list of supported systems, these tests can be removed as they are already part of the test set above.
context 'on FreeBDS' do
let(:facts) { { os: { family: 'FreeBSD' } } }
let(:facts) { { 'os' => { 'family' => 'FreeBSD' } } }

context 'With default params' do
let(:title) { 'test' }
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

require 'voxpupuli/test/spec_helper'

RSpec.configure do |c|
c.facterdb_string_keys = true
end

add_mocked_facts!

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
Expand Down
Loading