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

BREAKING: Ensure python package (adds manage_python option) #623

Merged
merged 1 commit into from
Sep 9, 2017

Conversation

wyardley
Copy link
Contributor

@wyardley wyardley commented Sep 8, 2017

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.

@wyardley wyardley changed the title Ensure python package is installed on Debian when admin_enable and service_manage are set Ensure python package on Debian when admin_enable and service_manage are set Sep 8, 2017
@wyardley wyardley added the bug Something isn't working label Sep 8, 2017
@wyardley wyardley force-pushed the ensure_python branch 2 times, most recently from 27cbc10 to 440ab00 Compare September 8, 2017 19:53
# 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']]
Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@wyardley
Copy link
Contributor Author

wyardley commented Sep 8, 2017

I think this should be a parameter after all, either default undef with the option of setting the package name (as python_ensure), e.g., python_ensure = python. We could do it as a boolean too, but then wouldn't be able to set the package name. I moved the OS specific logic to params.pp.

'command' => '/usr/bin/systemctl daemon-reload',
'notify' => 'Class[Rabbitmq::Service]',
'refreshonly' => true
command: '/usr/bin/systemctl daemon-reload',
Copy link
Contributor Author

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

@wyardley wyardley changed the title Ensure python package on Debian when admin_enable and service_manage are set Ensure python package (adds python_ensure option) Sep 8, 2017
@wyardley wyardley changed the title Ensure python package (adds python_ensure option) Ensure python package (adds manage_python option) Sep 8, 2017
@wyardley wyardley force-pushed the ensure_python branch 3 times, most recently from 60506de to 43e47e4 Compare September 9, 2017 04:23
@@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datatypes \o/

@@ -6,6 +6,7 @@

case $facts['os']['family'] {
'Archlinux': {
$manage_python = false
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

@@ -6,6 +6,7 @@

case $facts['os']['family'] {
'Archlinux': {
$manage_python = false
Copy link
Member

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.

@@ -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')
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

@wyardley wyardley force-pushed the ensure_python branch 3 times, most recently from 4c2ec67 to 58205ea Compare September 9, 2017 19:58
@wyardley
Copy link
Contributor Author

wyardley commented Sep 9, 2017

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.

@bastelfreak
Copy link
Member

looks good to me. @ekohl and objections here?

@wyardley wyardley removed the request for review from alexjfisher September 9, 2017 21:51
@wyardley wyardley changed the title Ensure python package (adds manage_python option) BREAKING: Ensure python package (adds manage_python option) Sep 9, 2017
@wyardley wyardley merged commit 2562077 into voxpupuli:master Sep 9, 2017
wyardley pushed a commit to wyardley/puppet-rabbitmq that referenced this pull request Sep 9, 2017
@wyardley wyardley deleted the ensure_python branch September 9, 2017 23:29
wyardley pushed a commit to wyardley/puppet-rabbitmq that referenced this pull request Sep 10, 2017
ekohl added a commit that referenced this pull request Sep 11, 2017
Fix test cases for #623 (manage_python)
wyardley pushed a commit to wyardley/puppet-rabbitmq that referenced this pull request Sep 12, 2017
Slm0n87 pushed a commit to Slm0n87/puppet-rabbitmq that referenced this pull request Mar 7, 2019
BREAKING: Ensure python package (adds manage_python option)
Slm0n87 pushed a commit to Slm0n87/puppet-rabbitmq that referenced this pull request Mar 7, 2019
Slm0n87 pushed a commit to Slm0n87/puppet-rabbitmq that referenced this pull request Mar 7, 2019
cegeka-jenkins pushed a commit to cegeka/puppet-rabbitmq that referenced this pull request Mar 26, 2021
cegeka-jenkins pushed a commit to cegeka/puppet-rabbitmq that referenced this pull request Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants