Showing with 286 additions and 475 deletions.
  1. +14 −0 .editorconfig
  2. +0 −2 .fixtures.yml
  3. +34 −4 .github/CONTRIBUTING.md
  4. +5 −5 .github/PULL_REQUEST_TEMPLATE.md
  5. +1 −1 .msync.yml
  6. +1 −0 .pmtignore
  7. +34 −106 .travis.yml
  8. +32 −1 CHANGELOG.md
  9. +21 −0 Dockerfile
  10. +13 −12 Gemfile
  11. +24 −6 README.md
  12. +24 −34 Rakefile
  13. +2 −2 manifests/conf.pp
  14. +17 −10 manifests/config.pp
  15. +2 −2 manifests/cron.pp
  16. +3 −3 manifests/defaults.pp
  17. +11 −3 manifests/hourly.pp
  18. +5 −4 manifests/init.pp
  19. +1 −1 manifests/params.pp
  20. +3 −3 manifests/rule.pp
  21. +1 −1 manifests/rules.pp
  22. +3 −3 metadata.json
  23. +0 −15 spec/acceptance/nodesets/centos-511-x64.yml
  24. +0 −15 spec/acceptance/nodesets/centos-6-x64.yml
  25. +0 −17 spec/acceptance/nodesets/centos-66-x64-pe.yml
  26. +0 −12 spec/acceptance/nodesets/centos-66-x64.yml
  27. +0 −15 spec/acceptance/nodesets/centos-7-x64.yml
  28. +0 −12 spec/acceptance/nodesets/centos-72-x64.yml
  29. +0 −15 spec/acceptance/nodesets/debian-78-x64.yml
  30. +0 −15 spec/acceptance/nodesets/debian-82-x64.yml
  31. +0 −12 spec/acceptance/nodesets/fedora-20-x64.yml
  32. +0 −15 spec/acceptance/nodesets/fedora-24-x64.yml
  33. +0 −16 spec/acceptance/nodesets/fedora-25-x64.yml
  34. +0 −16 spec/acceptance/nodesets/fedora-26-x64.yml
  35. +0 −18 spec/acceptance/nodesets/fedora-27-x64.yml
  36. +0 −15 spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
  37. +0 −15 spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
  38. +0 −15 spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
  39. +0 −4 spec/classes/coverage_spec.rb
  40. +1 −1 spec/classes/defaults_spec.rb
  41. +10 −0 spec/classes/init_spec.rb
  42. +0 −14 spec/default_facts.yml
  43. +1 −1 spec/defines/cron_spec.rb
  44. +2 −2 spec/defines/rule_spec.rb
  45. +21 −12 spec/spec_helper.rb
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

# MANAGED BY MODULESYNC

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 0 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
cron: "https://github.com/puppetlabs/puppetlabs-cron_core.git"
symlinks:
logrotate: "#{source_dir}"
38 changes: 34 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,34 @@ You can install all needed gems for spec tests into the modules directory by
running:

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

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release
bundle install --path .vendor/ --with system_tests --without development release --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/ --without development --with system_tests --without release; bundle update; bundle clean
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
environment variable:

```sh
BUNDLE_JOBS="$(nproc)"
```

### Note for OS X users

`nproc` isn't a valid command unter OS x. As an alternative, you can do:

```sh
--jobs "$(sysctl -n hw.ncpu)"
```

## Syntax and style
Expand Down Expand Up @@ -109,6 +124,21 @@ To run a specific spec test set the `SPEC` variable:
bundle exec rake spec SPEC=spec/foo_spec.rb
```

### Unit tests in docker

Some people don't want to run the dependencies locally or don't want to install
ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
You only need to run:

```sh
docker build .
```

Please ensure that a docker daemon is running and that your user has the
permission to talk to it. You can specify a remote docker host by setting the
`DOCKER_HOST` environment variable. it will copy the content of the module into
the docker image. So it will not work if a Gemfile.lock exists.

## Integration tests

The unit tests just check the code runs, not that it does exactly what
Expand Down Expand Up @@ -145,7 +175,7 @@ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
Beaker also supports docker containers. We also use that in our automated CI
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:

```
```sh
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
```

Expand Down
10 changes: 5 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Thank you for contributing to this project!
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.1.0'
modulesync_config_version: '2.8.0'
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Dockerfile
140 changes: 34 additions & 106 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,156 +1,84 @@
---
sudo: false
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
- rm -f Gemfile.lock
- gem update --system
- gem update bundler
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- rvm: 2.5.1
- 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.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1604-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1404-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1604-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1404-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian9-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker} CHECK=beaker
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian8-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
branches:
only:
- master
Expand Down
33 changes: 32 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,39 @@ 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.

## [v3.4.0](https://github.com/voxpupuli/puppet-logrotate/tree/v3.4.0) (2018-10-05)
## [v4.0.0](https://github.com/voxpupuli/puppet-logrotate/tree/v4.0.0) (2019-07-28)

[Full Changelog](https://github.com/voxpupuli/puppet-logrotate/compare/v3.4.0...v4.0.0)

**Breaking changes:**

- modulesync 2.7.0 and drop puppet 4 [\#147](https://github.com/voxpupuli/puppet-logrotate/pull/147) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- "su" and "su\_owner" parameters are not accepted in "conf" [\#40](https://github.com/voxpupuli/puppet-logrotate/issues/40)
- Use modern facts and $facts hash for osfamily [\#151](https://github.com/voxpupuli/puppet-logrotate/pull/151) ([simmerz](https://github.com/simmerz))
- Introduce new top level parameter manage\_cron\_hourly which defaults … [\#137](https://github.com/voxpupuli/puppet-logrotate/pull/137) ([cliff-wakefield](https://github.com/cliff-wakefield))

**Closed issues:**

- Unable to disable cron for hourly rotations [\#136](https://github.com/voxpupuli/puppet-logrotate/issues/136)

**Merged pull requests:**

- Allow puppetlabs-stdlib 6 [\#156](https://github.com/voxpupuli/puppet-logrotate/pull/156) ([jaredledvina](https://github.com/jaredledvina))
- Remove deprecated and unused is\_hash function [\#155](https://github.com/voxpupuli/puppet-logrotate/pull/155) ([baurmatt](https://github.com/baurmatt))
- Remove occurences of su\_owner [\#148](https://github.com/voxpupuli/puppet-logrotate/pull/148) ([adriankirchner](https://github.com/adriankirchner))
- Document possible use of Array for paths [\#145](https://github.com/voxpupuli/puppet-logrotate/pull/145) ([dleske](https://github.com/dleske))

## [v3.4.0](https://github.com/voxpupuli/puppet-logrotate/tree/v3.4.0) (2018-10-06)

[Full Changelog](https://github.com/voxpupuli/puppet-logrotate/compare/v3.3.0...v3.4.0)

**Breaking changes:**

- Remove unused parameter: logrotate::cron\_hourly\_file [\#140](https://github.com/voxpupuli/puppet-logrotate/pull/140) ([ruriky](https://github.com/ruriky))

**Implemented enhancements:**

- add support for Debian 8/9 and Ubuntu 18.04 [\#134](https://github.com/voxpupuli/puppet-logrotate/pull/134) ([rj667](https://github.com/rj667))
Expand All @@ -27,6 +56,8 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- modulesync 2.0.0 [\#142](https://github.com/voxpupuli/puppet-logrotate/pull/142) ([dhollinger](https://github.com/dhollinger))
- Release 3.4.0 and allow puppet 6.x [\#141](https://github.com/voxpupuli/puppet-logrotate/pull/141) ([dhollinger](https://github.com/dhollinger))
- enable acceptance tests centos 6/7 ubuntu 14/16 [\#135](https://github.com/voxpupuli/puppet-logrotate/pull/135) ([bastelfreak](https://github.com/bastelfreak))
- allow puppetlabs/stdlib 5.x [\#132](https://github.com/voxpupuli/puppet-logrotate/pull/132) ([bastelfreak](https://github.com/bastelfreak))

Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ruby:2.5.3

WORKDIR /opt/puppet

# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv

ARG PUPPET_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4

# Cache gems
COPY Gemfile .
RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle}

COPY . .

RUN bundle install
RUN bundle exec release_checks

# Container should not saved
RUN exit 1
Loading