Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add require_epel parameter, defaulting to true #997

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ 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.

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 "puppet/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 "puppet/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
Loading