Showing with 669 additions and 376 deletions.
  1. +3 −4 .github/CONTRIBUTING.md
  2. +6 −78 .github/workflows/ci.yml
  3. +10 −22 .github/workflows/release.yml
  4. +1 −1 .msync.yml
  5. +3 −2 .puppet-lint.rc
  6. +29 −1 CHANGELOG.md
  7. +1 −1 Dockerfile
  8. +3 −3 Gemfile
  9. +2 −2 README.md
  10. +128 −19 REFERENCE.md
  11. +1 −1 Rakefile
  12. +7 −4 lib/facter/redis_server_version.rb
  13. +13 −10 lib/puppet/functions/redis/get.rb
  14. +6 −3 manifests/init.pp
  15. +29 −5 manifests/instance.pp
  16. +25 −25 manifests/params.pp
  17. +8 −10 manifests/preinstall.pp
  18. +38 −1 manifests/sentinel.pp
  19. +7 −7 metadata.json
  20. +2 −0 spec/acceptance/hieradata/common.yaml
  21. +22 −18 spec/acceptance/redis_cli_task_spec.rb
  22. +2 −0 spec/acceptance/suites/default/redis_adminstration_spec.rb
  23. +2 −0 spec/acceptance/suites/default/redis_debian_run_dir_spec.rb
  24. +26 −11 spec/acceptance/suites/default/redis_multi_instances_one_host_spec.rb
  25. +2 −0 spec/acceptance/suites/default/redis_multi_node_spec.rb
  26. +3 −1 spec/acceptance/suites/default/redis_sentinel_one_node_spec.rb
  27. +2 −0 spec/acceptance/suites/default/redis_spec.rb
  28. +2 −0 spec/acceptance/suites/default/redisget_spec.rb
  29. +2 −0 spec/acceptance/suites/scl/redis5_spec.rb
  30. +2 −0 spec/classes/redis_administration_spec.rb
  31. +88 −64 spec/classes/redis_sentinel_spec.rb
  32. +83 −37 spec/classes/redis_spec.rb
  33. +11 −6 spec/defines/instance_spec.rb
  34. +10 −7 spec/functions/redis/get_spec.rb
  35. +5 −5 spec/spec_helper.rb
  36. +10 −6 spec/spec_helper_acceptance.rb
  37. +2 −0 spec/type_aliases/loglevel_spec.rb
  38. +2 −0 spec/type_aliases/redisurl_spec.rb
  39. +3 −0 spec/unit/redis_server_version_spec.rb
  40. +4 −1 tasks/redis_cli.rb
  41. +24 −0 templates/redis-sentinel.conf.erb
  42. +11 −0 templates/redis.conf.epp
  43. +29 −0 templates/service_templates/redis.service.epp
  44. +0 −21 templates/service_templates/redis.service.erb
7 changes: 3 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:

```sh
export PUPPET_VERSION="~> 5.5.6"
export PUPPET_GEM_VERSION="~> 5.5.6"
```

You can install all needed gems for spec tests into the modules directory by
Expand Down Expand Up @@ -232,17 +232,16 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian10-x64 bundle exec rake beaker
BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
The following strings are known to work:

* ubuntu1604
* ubuntu1804
* ubuntu2004
* debian9
* debian10
* debian11
* centos7
* centos8

Expand Down
84 changes: 6 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,12 @@ name: CI
on: pull_request

concurrency:
group: ${{ github.head_ref }}
group: ${{ github.ref_name }}
cancel-in-progress: true

jobs:
setup_matrix:
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
timeout-minutes: 40
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Run static validations
run: bundle exec rake validate lint check
- name: Run rake rubocop
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false

unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: 40
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 parallel_spec

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}

tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
32 changes: 10 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,14 @@ on:
tags:
- '*'

env:
BUNDLE_WITHOUT: development:test:system_tests

jobs:
deploy:
name: 'deploy to forge'
runs-on: ubuntu-latest
if: github.repository_owner == 'voxpupuli'
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
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v1
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 }}
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: '4.2.0'
modulesync_config_version: '5.2.0'
5 changes: 3 additions & 2 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--with-filename
#--no-80chars-check
--fail-on-warnings
--no-parameter_documentation-check
--no-parameter_types-check
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,35 @@ 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.

## [v8.2.0](https://github.com/voxpupuli/puppet-redis/tree/v8.2.0) (2021-10-11)
## [v8.3.0](https://github.com/voxpupuli/puppet-redis/tree/v8.3.0) (2022-04-04)

[Full Changelog](https://github.com/voxpupuli/puppet-redis/compare/v8.2.0...v8.3.0)

**Implemented enhancements:**

- Add tls settings to the redis::sentinel class and the redis-sentinel.conf template [\#443](https://github.com/voxpupuli/puppet-redis/pull/443) ([tparkercbn](https://github.com/tparkercbn))
- Add Debian 11 support [\#440](https://github.com/voxpupuli/puppet-redis/pull/440) ([ekohl](https://github.com/ekohl))
- Drop default PPA setting and only install EPEL on EL7 [\#435](https://github.com/voxpupuli/puppet-redis/pull/435) ([ekohl](https://github.com/ekohl))
- CentOS9/RHEL9: Migrate configuration files to /etc/redis [\#434](https://github.com/voxpupuli/puppet-redis/pull/434) ([kajinamit](https://github.com/kajinamit))
- conditional instance restarts on config file changes [\#433](https://github.com/voxpupuli/puppet-redis/pull/433) ([aamerik](https://github.com/aamerik))
- manage additional redis modules [\#426](https://github.com/voxpupuli/puppet-redis/pull/426) ([ymartin-ovh](https://github.com/ymartin-ovh))
- service\_template RuntimeDirectory [\#424](https://github.com/voxpupuli/puppet-redis/pull/424) ([aamerik](https://github.com/aamerik))

**Fixed bugs:**

- Fix issue redis.conf being world readable [\#427](https://github.com/voxpupuli/puppet-redis/pull/427) ([jnguiot](https://github.com/jnguiot))

**Closed issues:**

- Single instance systemd service won't start on Arch Linux [\#439](https://github.com/voxpupuli/puppet-redis/issues/439)

**Merged pull requests:**

- Drop Archlinux support [\#441](https://github.com/voxpupuli/puppet-redis/pull/441) ([ekohl](https://github.com/ekohl))
- Fix running acceptance tests in non-Docker environments [\#437](https://github.com/voxpupuli/puppet-redis/pull/437) ([ekohl](https://github.com/ekohl))
- Correct docs on redis::get & regenerate REFERENCE.md [\#436](https://github.com/voxpupuli/puppet-redis/pull/436) ([ekohl](https://github.com/ekohl))

## [v8.2.0](https://github.com/voxpupuli/puppet-redis/tree/v8.2.0) (2021-10-13)

[Full Changelog](https://github.com/voxpupuli/puppet-redis/compare/v8.1.1...v8.2.0)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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 PUPPET_GEM_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4

# Cache gems
Expand Down
6 changes: 3 additions & 3 deletions 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', '~> 2.5', :require => false
gem 'voxpupuli-test', '~> 5.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 1.0', :require => false
Expand All @@ -23,14 +23,14 @@ end

group :release do
gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5'
gem 'voxpupuli-release', '>= 1.0.2', :require => false
gem 'voxpupuli-release', '>= 1.2.0', :require => false
gem 'puppet-strings', '>= 2.2', :require => false
end

gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]

puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0'
puppetversion = ENV['PUPPET_GEM_VERSION'] || '>= 6.0'
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class { '::redis':
}
```

On Ubuntu, "chris-lea/redis-server" ppa repo will be added. You can change it by using ppa_repo parameter:
On Ubuntu, you can use a PPA by using the `ppa_repo` parameter:

```puppet
class { '::redis':
Expand All @@ -111,7 +111,7 @@ class { '::redis':
}
```

**Warning** note that it requires [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) on Ubuntu distros. On Red Hat [puppet/epel](https://forge.puppet.com/puppet/epel) is needed unless the installation is using Software Collections. In that case will install `centos-release-scl-rh` from CentOS extras. For RHEL or other RHEL-derivatives this isn't managed.
**Warning** note that PPA usage requires [puppetlabs/apt](https://forge.puppet.com/puppetlabs/apt) on Ubuntu distros. On EL7 [puppet/epel](https://forge.puppet.com/puppet/epel) is needed unless the installation is using Software Collections. In that case will install `centos-release-scl-rh` from CentOS extras. For RHEL or other RHEL-derivatives this isn't managed.

### Redis Sentinel

Expand Down
Loading