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

Add a way to change package name and command #34

Merged
merged 2 commits into from
May 25, 2016

Conversation

glorpen
Copy link
Contributor

@glorpen glorpen commented May 23, 2016

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.

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:
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@domcleal
Copy link
Contributor

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?

@danzilio
Copy link
Member

Hmm not sure why the tests haven't run on this...

@glorpen
Copy link
Contributor Author

glorpen commented May 24, 2016

@domcleal Param letsencrypt::certonly::letsencrypt_command defaults to $letsencrypt::command, in this PR $letsencrypt::command is constructed from $package_command when in package mode, so it should work as expected... or am I not seeing something?

@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.

@domcleal
Copy link
Contributor

Param letsencrypt::certonly::letsencrypt_command defaults to $letsencrypt::command, in this PR $letsencrypt::command is constructed from $package_command when in package mode, so it should work as expected... or am I not seeing something?

Ah yes, thanks for the explanation! I missed that $command was set to $package_command. Looks good!

@danzilio danzilio merged commit fcadeb2 into voxpupuli:master May 25, 2016
@glorpen glorpen deleted the package branch May 25, 2016 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants