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

Fixes #33089 - move (hammer_)plugin_prefix to globals #974

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Jul 21, 2021

No description provided.

@evgeni
Copy link
Member Author

evgeni commented Jul 21, 2021

@ekohl I guess moving version to globals would be something you'd be in favor of? What else?

Comment on lines 26 to 28
'Linux': {
case $facts['os']['name'] {
'Amazon': {
Copy link
Member

Choose a reason for hiding this comment

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

I just checked and it looks like Amazon Linux is still qualified in the Red Hat OS family. At some point we should clean this up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not me, not today, not enough 💥 ;)

@@ -9,7 +9,7 @@
# $version:: The package version to ensure
#
define foreman::cli::plugin (
String $package = "${foreman::cli::hammer_plugin_prefix}${title}",
String $package = "${foreman::cli::params::hammer_plugin_prefix}${title}",
Copy link
Member

Choose a reason for hiding this comment

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

Technically this doesn't have to change due to inheritance.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe. I was blindly copying from theforeman/puppet-foreman_proxy@935d45a ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly, if I'd read foreman::cli::hammer_plugin_prefix here, and wouldn't find it in cli.pp, I'd be confused at first, so I think explicitly using the one from params seems friendlier to the reader to me

Copy link
Member

Choose a reason for hiding this comment

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

I've seen others confused by that as well so I guess it's ok.

@@ -93,27 +93,27 @@
# We use system packages except on EL7
if versioncmp($facts['os']['release']['major'], '8') >= 0 {
$passenger_ruby_package = undef
$plugin_prefix = 'rubygem-foreman_'
$_plugin_prefix = 'rubygem-foreman_'
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 for both EL7 & EL8 we can nowadays use foreman-plugin- as a prefix. Puppet should support Provides and it would simplify matters. For example, the puppetdb plugin also follows the same convention (tasks appears to be foreman-plugin-foreman-tasks). Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would surely make a great follow up PR? ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

But yes, puppet 5.5 already has the virtual_packages feature in yum and dnf providers, so it's probably safe to switch to that.

Copy link
Member

Choose a reason for hiding this comment

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

An noting it down explicitly: we don't have a similar provides for Hammer plugins. We should, but that means we can't immediately depend on it.

Copy link
Member

Choose a reason for hiding this comment

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

If we'd like to do that in the future, can an issue be filed to track it?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Should we file issues for the Foreman Proxy equivalents too while we're at it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, sounds good. I just didn't think of it as it's not part of this PR

Copy link
Member

Choose a reason for hiding this comment

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

Shall I create them or will you? Just so we don't end up with duplicates.

Copy link
Member Author

Choose a reason for hiding this comment

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

You. I'm away from the pc

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I'm ok with this. Let's move other variables in separate PRs.

@ehelms @wbclark please also have a look.

As for other variables:

  • version & plugin_version - I can still see a use case so I'm not entirely sure.
  • user & group - these are hardly ever changed so I'd be in favor of moving them
  • rails_env & app_root same
  • vhost_priority same (perhaps even move it to apache.pp and only allow changing it via Hiera)

@ekohl ekohl merged commit 08254ec into theforeman:master Jul 22, 2021
@evgeni
Copy link
Member Author

evgeni commented Jul 22, 2021

Thanks!

I've also opened https://projects.theforeman.org/issues/33106 to track the extraction of the other variables

@evgeni evgeni mentioned this pull request Jul 22, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants