-
Notifications
You must be signed in to change notification settings - Fork 136
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 a way to change package name and command #34
Conversation
This change adds package_name and package_command params and as a bonus support for Gentoo. Test for this use case was also created. Name and command params default to their old values, so change should be fully backward compatible.
@@ -53,13 +57,13 @@ | |||
revision => $version, | |||
} | |||
} else { | |||
package { 'letsencrypt': | |||
package { $package_name: |
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.
Nitpick, I'd suggest to keep the resource title the same (e.g. Package[letsencrypt]
) but supply the name
parameter with the varying value, then it's less confusing if $package_name
isn't set correctly or somebody wants to add a relationship on the resource.
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.
In the adding relationship case, wouldn't it be expected to have working Package[$my_pkg]
when providing $package_name
, eg. class {'letsencrypt': package_name => $my_pkg}
? After all it is named "package_name".
I'm not really sure about the "right way" here ... (reads puppet documentation) ... I guess I don't find the aliasing feature as clean ;) So if your suggestion still stands, I'll add name
parameter.
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.
In the adding relationship case, wouldn't it be expected to have working Package[$my_pkg] when providing $package_name, eg. class {'letsencrypt': package_name => $my_pkg}? After all it is named "package_name".
Yeah, if you're passing in package_name then I guess you know it - but if it's derived from params.pp then you might not.
It's probably personal preference.
Could you also update letsencrypt::certonly to use the command name? The package has also changed to certbot in EPEL7, but I'd be happy to send a followup PR to rename the package there too. Note that tests haven't run, perhaps they're not enabled correctly on this repo? |
Hmm not sure why the tests haven't run on this... |
@domcleal Param @danzilio While this PR was created, GitHub had some problems with cache/load balancing/something, so my guess is that after next change tests will run normally. |
Ah yes, thanks for the explanation! I missed that $command was set to $package_command. Looks good! |
This change adds package_name and package_command params
and as a bonus support for Gentoo. Test for this use case
was also created.
Name and command params default to their old values,
so change should be fully backward compatible.