-
-
Notifications
You must be signed in to change notification settings - Fork 165
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 boolean to control EPEL #181
Conversation
manifests/init.pp
Outdated
# [*python_use_epel*] | ||
# (bool) Whether the Python class will use attempt to manage EPEL or not. | ||
# Defaults to true ($::puppetboard::params::python_use_epel) | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default for fedora users was actually false
though. https://github.com/stankevich/puppet-python/blob/718e9bc482f72559d9035ec2b8b651be01984128/manifests/params.pp#L25 So this would change the default behaviour for them.
I'm not sure we want to be replicating the logic in that class in our own params.pp though... Dunno. Maybe someone else will have a suggestion.
@@ -289,6 +294,7 @@ | |||
class { '::python': | |||
virtualenv => 'present', | |||
dev => 'present', | |||
use_epel => $python_use_epel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might also be backwards incompatible for any users that have already worked around the issue by setting python::use_epel: false
in their hiera?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot how hiera handles this. If it's undef, won't it still use the hiera value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it an optional boolean vs. just a boolean again? And even if they had set python::use_epel: false
earlier, would this actually generate an error if this setting were also false, or just be redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, to try to avoid changing existing behavior. Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl Not sure. It's probably not too much of a big deal.
7427cb3
to
9dc632b
Compare
Both good points. Attempt no. 2 - Boolean is now a Variant and defaults to undef, so the internal behaviours won't change (ie: Fedora) and Hiera will still kick in if people are tuning Class[python] it that way. FYI: this set of tests looks broken. /etc/apache2 on Red Hat...? Leaving it alone, I think it's working on Travis by magic (it fails when I test locally). |
manifests/init.pp
Outdated
@@ -173,6 +177,7 @@ | |||
$python_loglevel = $::puppetboard::params::python_loglevel, | |||
$python_proxy = $::puppetboard::params::python_proxy, | |||
$python_index = $::puppetboard::params::python_index, | |||
Variant[Boolean, Undef] $python_use_epel = undef, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably more common to use Optional[Boolean] $var_name = undef
but I think that's just a style thing.
IChanged to an Optional. |
Anything else holding up this PR? |
Hi @lukebigum, could you also provide a fix for the rubocop issue? |
Hi, the Rubocop issue is on spec/spec_helper_acceptance.rb, which I assumed was managed by Voxpupuli's Module Sync. I can fix it, but it might just get overwritten again. |
@lukebigum Good news is spec/spec_helper_acceptance.rb is not managed my modulesync. If you think you can fix it, that'd be much appreciated. |
5fc13fb
to
7946ff8
Compare
@alexjfisher I've looked, but now I think it's a false positive. The code style that rubocop-rspec is trying to catch is geared towards a very simple array loop in rspec, and this is not an Rspec test file (thus not possible to use rspec's all matcher here). I've disabled that test for that file. |
@lukebigum, what's the point if EPEL is actually not needed? |
@tux-o-matic I don't understand what you mean. Class[puppetboard] declares Class[python] in such a way that it pulls in Class[epel] by default. This patch changes Class[puppetboard] so that it declares Class[python] with the 'use_epel' parameter, allowing you to turn that off, if say, you don't want to Class[epel] in your catalog. |
@lukebigum, as I discovered out in #166, the only reason to need EPEL is for virtualenv on EL 6. And to get virtualenv on EL 6 you could within this module:
|
@tux-o-matic that's exactly what I don't want to do. Such an approach assumes that you can simply create Yumrepo resources and Pip packages in my environment and it would all work perfectly. That would work for most people with free access to the Internet, think... "behind giant corporate firewall". I could do that, but again I'd need to wrap all of said functionality in a Boolean so I personally could turn it off. |
@lukebigum The Yumrepo resource supports the proxy option, I've been using it. The pip provider can inherit proxy settings from the environment, can't recall how but I frequently use it on nodes behind a proxy. |
@tux-o-matic, the ability to proxy may help some people, but that's still not the point. My EPEL repository is already on the box, put there with Pulp, and it works perfectly fine. I don't need to proxy anything, nor do I need this module to help me manage EPEL, which is the real issue. This module assumes too much. It is trying to be too helpful. Dare I say... It's like the Microsoft Word Paperclip :-) There are many good examples of modules that by default try to by helpful and set up lots of for you, but still allow you to disable this functionality if you have the need to do it yourself. ajcrowe/supervisord is one good example. I'm all for being helpful, but at least allow me to turn it off, or merge my PR that allows me to turn it off ;-) |
I agree, it's trying to do too much by default. |
Shameless bump. Both this PR and #166 are trying to make this module less tightly coupled. Anyone want to merge or provide additional feedback on either? |
@lukebigum, you can take your PR further. I made a whole new module to install Puppetboard so I'm no longer using this module . |
@alexjfisher anything remaining that needs to be changed for this one? |
manifests/params.pp
Outdated
@@ -54,6 +54,7 @@ | |||
$python_loglevel = 'info' | |||
$python_proxy = false | |||
$python_index = false | |||
$python_use_epel = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do? You are defaulting to undef
in init.pp not $::puppetboard::params::python_use_epel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this just needs coming out.
1bf672f
to
f59ad70
Compare
Good spot, left over from a previous change. Removed the unused variable and also fixed a rubocop merge conflict. |
It looks like you merged master. It would help reviewing if you rebased on master instead. |
Fixed my poor merge, please let me know any other feedback. |
.rubocop.yml
Outdated
@@ -527,6 +528,10 @@ RSpec/NestedGroups: | |||
Layout/IndentHeredoc: | |||
Enabled: False | |||
|
|||
Rspec/IteratedExpectation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary now, .rubocop.yml
is managed by modulesync, but current master doesn't have any rubocop warnings, so as long as this PR didn't change spec_helper_acceptance, shouldn't be necessary.
For some reason, I don't see this when I check out the PR locally.
…ge EPEL or not - useful for environments that mirror EPEL internally.
You are right, I've removed the rubocop change and it still passes. |
Thanks @lukebigum! |
Add boolean to explicitly control whether Class[python] tries to manage EPEL or not - useful for environments that mirror EPEL internally.
This directly conflicts with #176 - but my commit is backwards compatible as EPEL will continue to be managed by default.
Note the Rubocop failure is on spec/spec_helper_acceptance.rb which is probably managed by Voxpupuli's Module Sync, so while I could make the Rubocop warning go away, my change will be overwritten by any msync from upstream :-)