Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This approach to adding the EPEL dependency uses a few more lines of code than the alternative, but it means that the EPEL module only gets called if the OS (RedHat) and OS Version require it.
Note: Even if the EPEL module were included on a different OS (e.g. Ubuntu) the module logic of the EPEL module doesn't do anything unless it's on a RedHat osfamily system.
An alternative method to accomplish this would be to just unconditionally include the EPEL module, and set it as a require for the pip and virtualenv package resources. On Ubuntu this would mean that puppet output would show the EPEL module being used but nothing would be done to the system. On RedHat the EPEL yum repo configs would be installed even if the user was on RHEL 7 and only looking to install virtualenv (not pip) in which case EPEL is not required because RHEL 7 provides virtualenv in the base repositories.
I figured that the method in this PR would be better than the alternative as it would only involve the EPEL module when required, even though that resulted in a couple more lines of conditional logic.
One other thing to note is that regardless of the OS (Ubuntu RedHat), the EPEL module would be downloaded because this PR sets it as a metadata.json dependency. This means on an Ubuntu system, puppet (or librarian-puppet or whatever you use to fetch puppet modules) would download the EPEL module, but would not use it. It would just be in the modules directory unused. I can't think of a way around this because module dependencies (like those recorded in metadata.json) aren't conditional and can't depend on the OS. I don't think it's a big problem though.
Fixes #196