Skip to content

Commit

Permalink
Add require_epel parameter, defaulting to true
Browse files Browse the repository at this point in the history
Allow an option to restore epel as a true soft dependency. Defaulting to
`true` so that the tests will work with default behavior.
Fixes #995
  • Loading branch information
wyardley committed May 20, 2024
1 parent 137edee commit b0cf4e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ These are now documented via [Puppet Strings](https://github.com/puppetlabs/pupp

You can view example usage in [REFERENCE](REFERENCE.md).

**[puppet/epel](https://forge.puppet.com/modules/puppet/epel) is a soft dependency. The module requires it if you're on CentOS 7**
**[puppet/epel](https://forge.puppet.com/modules/puppet/epel) is a soft dependency. If you're on CentOS 7 and don't want to require it, set `$require_epel` to `false`**

Version v13.2.0 and older also added an erlang repository on CentOS 7. That isn't used and can be safely removed.
Version v13.2.0 and older also added an erlang module on CentOS 7. That isn't used and can be safely removed.

## Reference

Expand Down
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ The following parameters are available in the `rabbitmq` class:
* [`port`](#-rabbitmq--port)
* [`python_package`](#-rabbitmq--python_package)
* [`repos_ensure`](#-rabbitmq--repos_ensure)
* [`require_epel`](#-rabbitmq--require_epel)
* [`service_ensure`](#-rabbitmq--service_ensure)
* [`service_manage`](#-rabbitmq--service_manage)
* [`service_name`](#-rabbitmq--service_name)
Expand Down Expand Up @@ -800,6 +801,14 @@ different ways of handling the erlang deps. See also https://github.com/voxpupu

Default value: `false`

##### <a name="-rabbitmq--require_epel"></a>`require_epel`

Data type: `Boolean`

If this parameter is set, On CentOS / RHEL 7 systems, require the "epel" module

Default value: `true`

##### <a name="-rabbitmq--service_ensure"></a>`service_ensure`

Data type: `Enum['running', 'stopped']`
Expand Down
10 changes: 9 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@
# Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
# It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
# different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788
# @param require_epel
# If this parameter is set, On CentOS / RHEL 7 systems, require the "epel" module
# @param service_ensure
# The state of the service.
# @param service_manage
Expand Down Expand Up @@ -453,6 +455,7 @@
Array $archive_options = [],
Array $loopback_users = ['guest'],
Boolean $service_restart = true,
Boolean $require_epel = true,
) {
if $ssl_only and ! $ssl {
fail('$ssl_only => true requires that $ssl => true')
Expand Down Expand Up @@ -507,7 +510,12 @@
default: {
}
}
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') {
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') and $require_epel {
# On later CentOS / RHEL systems, this is not useful since EPEL doesn't
# have the rabbitmq-server package anyway.
#
# Once support for 7 is dropped, we should remove this code and the
# parameter
require epel
}

Expand Down

0 comments on commit b0cf4e5

Please sign in to comment.