Skip to content

Commit f7d30b8

Browse files
committed
Add require_epel parameter, defaulting to true
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
1 parent 8bd94b8 commit f7d30b8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ These are now documented via [Puppet Strings](https://github.com/puppetlabs/pupp
4949

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

52-
**[puppet/epel](https://forge.puppet.com/modules/puppet/epel) is a soft dependency. The module requires it if you're on CentOS 7**
52+
**[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`**
5353

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

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ The following parameters are available in the `rabbitmq` class:
254254
* [`port`](#-rabbitmq--port)
255255
* [`python_package`](#-rabbitmq--python_package)
256256
* [`repos_ensure`](#-rabbitmq--repos_ensure)
257+
* [`require_epel`](#-rabbitmq--require_epel)
257258
* [`service_ensure`](#-rabbitmq--service_ensure)
258259
* [`service_manage`](#-rabbitmq--service_manage)
259260
* [`service_name`](#-rabbitmq--service_name)
@@ -801,6 +802,14 @@ different ways of handling the erlang deps. See also https://github.com/voxpupu
801802

802803
Default value: `false`
803804

805+
##### <a name="-rabbitmq--require_epel"></a>`require_epel`
806+
807+
Data type: `Boolean`
808+
809+
If this parameter is set, On CentOS / RHEL 7 systems, require the "puppet/epel" module
810+
811+
Default value: `true`
812+
804813
##### <a name="-rabbitmq--service_ensure"></a>`service_ensure`
805814

806815
Data type: `Enum['running', 'stopped']`

manifests/init.pp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@
243243
# Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
244244
# It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
245245
# different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788
246+
# @param require_epel
247+
# If this parameter is set, On CentOS / RHEL 7 systems, require the "puppet/epel" module
246248
# @param service_ensure
247249
# The state of the service.
248250
# @param service_manage
@@ -456,6 +458,7 @@
456458
Array $archive_options = [],
457459
Array $loopback_users = ['guest'],
458460
Boolean $service_restart = true,
461+
Boolean $require_epel = true,
459462
) {
460463
if $ssl_only and ! $ssl {
461464
fail('$ssl_only => true requires that $ssl => true')
@@ -510,7 +513,12 @@
510513
default: {
511514
}
512515
}
513-
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') {
516+
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') and $require_epel {
517+
# On later CentOS / RHEL systems, this is not useful since EPEL doesn't
518+
# have the rabbitmq-server package anyway.
519+
#
520+
# Once support for 7 is dropped, we should remove this code and the
521+
# parameter
514522
require epel
515523
}
516524

0 commit comments

Comments
 (0)