-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
BREAKING: Ensure python package (adds manage_python option) #623
Conversation
3b80852
to
4c35984
Compare
27cbc10
to
440ab00
Compare
manifests/install/rabbitmqadmin.pp
Outdated
# Newer versions of Ubuntu (16.04) ship with Python 3 only by default. | ||
if $facts['os']['family'] == 'Debian' { | ||
ensure_packages('python') | ||
$rabbitmqadmin_require = [Archive['rabbitmqadmin'], Package['python']] |
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.
Not sure if there's a cleaner way to do this
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.
also, this logic needs to be moved to params, and I think it probably does need to be configurable.
I think this should be a parameter after all, either default |
440ab00
to
b5f27b7
Compare
'command' => '/usr/bin/systemctl daemon-reload', | ||
'notify' => 'Class[Rabbitmq::Service]', | ||
'refreshonly' => true | ||
command: '/usr/bin/systemctl daemon-reload', |
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.
not sure why rubocop wasn't complaining about these before
60506de
to
43e47e4
Compare
@@ -213,6 +215,7 @@ | |||
Optional[String] $package_provider = undef, | |||
Boolean $repos_ensure = $rabbitmq::params::repos_ensure, | |||
$manage_repos = undef, | |||
Boolean $manage_python = $rabbitmq::params::manage_python, |
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.
datatypes \o/
manifests/params.pp
Outdated
@@ -6,6 +6,7 @@ | |||
|
|||
case $facts['os']['family'] { | |||
'Archlinux': { | |||
$manage_python = false |
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.
do we need python only on debian like systems?
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 we can require python on all platforms. It's ensure_packages
so there's less chance for conflicts and otherwise we provide the option to disable it.
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.
We can if you think that makes sense. My thought was to take a conservative approach, since a) I don't know for sure which systems don't already have it, and b) I don't know if the python 2 package name is consistent across all those platforms, and we don't do acceptance tests on all of them. Once this is enabled, we could switch the param for other platforms. Thoughts?
manifests/params.pp
Outdated
@@ -6,6 +6,7 @@ | |||
|
|||
case $facts['os']['family'] { | |||
'Archlinux': { | |||
$manage_python = false |
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 we can require python on all platforms. It's ensure_packages
so there's less chance for conflicts and otherwise we provide the option to disable it.
manifests/install/rabbitmqadmin.pp
Outdated
@@ -3,6 +3,14 @@ | |||
|
|||
require '::archive' | |||
|
|||
# Newer versions of Ubuntu (16.04) ship with Python 3 only by default. | |||
if $rabbitmq::manage_python { | |||
ensure_packages('python') |
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.
https://github.com/puppetlabs/puppetlabs-stdlib#ensure_packages states it takes a list of packages so I'm surprised this works.
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.
Yeah, I think it does work, but I forced it to list context, which I think is cleaner.
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 can switch it to managing it for all platforms, seems kind of silly for RHEL / CentOS, where I think it's a hard dependency for tools like yum / anaconda.
Do we know what the package is called on SUSE?
4c2ec67
to
58205ea
Compare
Ok, how do we feel about this behavior now, @ekohl @bastelfreak? I don't have a way to test on all of these platforms, though verified that the package is python2 on FreeBSD (so presumably on OBSD as well). I added the package name in params but didn't make it configurable. |
58205ea
to
444fc92
Compare
looks good to me. @ekohl and objections here? |
Fix test cases for #623 (manage_python)
BREAKING: Ensure python package (adds manage_python option)
Fix test cases for voxpupuli#623 (manage_python)
Fix test cases for voxpupuli#623 (manage_python)
This is needed for Ubuntu 16.04+ where only Python 3 is installed by default.
This could cause issues in some cases where people have defined the Python package elsewhere, I'm open to suggestions on how to do this more sanely, though really hoping to avoid an additional parameter.
If RabbitMQ distributed it in the package, the dependency could be handled more cleanly.