39 changes: 30 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,29 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development system_tests release'
bundle install --jobs "$(nproc)"
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
bundle update
bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
Expand Down Expand Up @@ -232,18 +242,29 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian11-64 bundle exec rake beaker
BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
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:

* ubuntu1804
* ubuntu2004
* debian10
* ubuntu2204
* debian11
* centos7
* centos8
* debian12
* centos9
* archlinux
* almalinux8
* almalinux9
* fedora36

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
5 changes: 3 additions & 2 deletions .rspec → .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

--format documentation
--color
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:
- "*"
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

name: CI

on: pull_request
on:
pull_request: {}
push:
branches:
- main
- master

concurrency:
group: ${{ github.ref_name }}
Expand All @@ -13,6 +18,4 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
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
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ on:
jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
with:
allowed_owner: 'voxpupuli'
secrets:
# Configure secrets here:
# 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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.*.sw?
/.yardoc/
/Guardfile
bolt-debug.log
.rerun.json
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: '6.0.0'
modulesync_config_version: '9.1.0'
8 changes: 5 additions & 3 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ PreCommit:
enabled: true
description: 'Runs rubocop on modified files only'
command: ['bundle', 'exec', 'rubocop']
PuppetLint:
RakeTarget:
enabled: true
description: 'Runs puppet-lint on modified files only'
command: ['bundle', 'exec', 'puppet-lint']
description: 'Runs lint on modified files only'
targets:
- 'lint'
command: ['bundle', 'exec', 'rake']
YamlSyntax:
enabled: true
JsonSyntax:
Expand Down
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
/.yardoc/
/.yardopts
/Dockerfile
/HISTORY.md
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
4 changes: 0 additions & 4 deletions .rspec_parallel

This file was deleted.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v4.2.0](https://github.com/voxpupuli/puppet-cron/tree/v4.2.0) (2024-07-10)

[Full Changelog](https://github.com/voxpupuli/puppet-cron/compare/v4.1.0...v4.2.0)

**Implemented enhancements:**

- Add support for FreeBSD 14 [\#136](https://github.com/voxpupuli/puppet-cron/pull/136) ([smortex](https://github.com/smortex))
- Add parameters for file/directory modes [\#134](https://github.com/voxpupuli/puppet-cron/pull/134) ([ludovicus3](https://github.com/ludovicus3))

**Merged pull requests:**

- refactor: define job template as epp instead of erb [\#138](https://github.com/voxpupuli/puppet-cron/pull/138) ([bastelfreak](https://github.com/bastelfreak))
- Remove legacy top-scope syntax [\#125](https://github.com/voxpupuli/puppet-cron/pull/125) ([smortex](https://github.com/smortex))

## [v4.1.0](https://github.com/voxpupuli/puppet-cron/tree/v4.1.0) (2023-08-08)

[Full Changelog](https://github.com/voxpupuli/puppet-cron/compare/v4.0.0...v4.1.0)
Expand Down
24 changes: 0 additions & 24 deletions Dockerfile

This file was deleted.

10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 6.0', :require => false
gem 'voxpupuli-test', '~> 9.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 3.0', :require => false
gem 'puppet_metadata', '~> 4.0', :require => false
end

group :development do
Expand All @@ -16,13 +16,11 @@ group :development do
end

group :system_tests do
gem 'voxpupuli-acceptance', '~> 2.0', :require => false
gem 'voxpupuli-acceptance', '~> 3.0', :require => false
end

group :release do
gem 'github_changelog_generator', '>= 1.16.1', :require => false
gem 'voxpupuli-release', '~> 3.0', :require => false
gem 'faraday-retry', '~> 2.1', :require => false
gem 'voxpupuli-release', '~> 3.0', :require => false
end

gem 'rake', :require => false
Expand Down
19 changes: 18 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ The following parameters are available in the `cron` class:
* [`crontab_mailto`](#-cron--crontab_mailto)
* [`crontab_home`](#-cron--crontab_home)
* [`crontab_run_parts`](#-cron--crontab_run_parts)
* [`file_mode`](#-cron--file_mode)
* [`dir_mode`](#-cron--dir_mode)
* [`package_ensure`](#-cron--package_ensure)

##### <a name="-cron--service_name"></a>`service_name`
Expand Down Expand Up @@ -228,6 +230,22 @@ Define sadditional cron::run_parts resources

Default value: `{}`

##### <a name="-cron--file_mode"></a>`file_mode`

Data type: `Stdlib::Filemode`

The file mode for the system crontab file

Default value: `'0644'`

##### <a name="-cron--dir_mode"></a>`dir_mode`

Data type: `Stdlib::Filemode`

The file mode for the cron directories

Default value: `'0755'`

##### <a name="-cron--package_ensure"></a>`package_ensure`

Data type: `Cron::Package_ensure`
Expand Down Expand Up @@ -616,7 +634,6 @@ Array[Struct[{
Optional['month'] => Cron::Month,
Optional['weekday'] => Cron::Weekday,
Optional['special'] => Cron::Special,
Optional['environment'] => Cron::Environment,
Optional['user'] => Cron::User,
Optional['description'] => String,
}]]
Expand Down
8 changes: 6 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# @param crontab_mailto The value for MAILTO in /etc/crontab
# @param crontab_home The value for HOME in /etc/crontab
# @param crontab_run_parts Define sadditional cron::run_parts resources
# @param file_mode The file mode for the system crontab file
# @param dir_mode The file mode for the cron directories
#
# @example simply include the module
# include cron
Expand Down Expand Up @@ -45,6 +47,8 @@
String[1] $crontab_mailto = 'root',
Optional[Stdlib::Absolutepath] $crontab_home = undef,
Cron::Run_parts $crontab_run_parts = {},
Stdlib::Filemode $file_mode = '0644',
Stdlib::Filemode $dir_mode = '0755',
) {
contain 'cron::install'
contain 'cron::service'
Expand Down Expand Up @@ -83,7 +87,7 @@
ensure => file,
owner => 'root',
group => 0,
mode => '0644',
mode => $file_mode,
content => epp('cron/crontab.epp'),
}

Expand All @@ -92,7 +96,7 @@
ensure => directory,
owner => 'root',
group => 0,
mode => '0755',
mode => $dir_mode,
before => File['/etc/crontab'],
}
}
Expand Down
14 changes: 13 additions & 1 deletion manifests/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@
group => $group,
mode => $mode,
path => "/etc/cron.d/${title}",
content => template('cron/job.erb'),
content => epp('cron/job.epp', {
name => $name,
environment => $environment,
description => $description,
special => $special,
user => $user,
command => $command,
minute => $minute,
hour => $hour,
date => $date,
month => $month,
weekday => $weekday,
}),
}
}
}
Expand Down
Loading