-
-
Notifications
You must be signed in to change notification settings - Fork 39
Parameterize targetfile in puppetserver::config::bootstrap #54
base: master
Are you sure you want to change the base?
Conversation
} else { | ||
$targetfile = '/etc/puppetserver/bootstrap.cfg' | ||
if versioncmp($::puppetversion, '4.0.0') >= 0 { |
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.
Shouldn't this be using the version of the puppetserver software and not the agent? I realize you are maintaining the current functionality, though it seems that is not what should happen here.
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.
Yes that's exactly what I described in the issue #52. From my knowledge there is no puppetserver version fact available to achieve that.
We had the same issue in your ssh module [1] and I found no workaround for puppet master software related version numbers.
[1] https://github.com/ghoneycutt/puppet-module-common/blob/master/manifests/mkuser.pp#L113-L117
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.
Could you add a small comment to the code and link to your issue? That would really help those who might be debugging this issue as it is possible they have the new agent and slightly older puppetserver.
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.
comment added
@@ -113,6 +113,17 @@ puppetserver::config::bootstrap { 'puppetlabs.services.ca.certificate-authority- | |||
} | |||
``` | |||
|
|||
A Puppetserver >= 2.5.0 ca.cfg entry. |
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.
This is a bit confusing as the define actually does this for us, so it is not needed here.
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.
The define is not aware of the used puppetserver version, so it will not be able to choose the correct path. You need to manually set this.
If $puppetserver::version would always contain a version number we could use that, but it is needed to also support the default of 'present' that can be any version.
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.
Technical it would be possible to use generate()
to get the used puppetserver version.
Usually I would prefer to avoid generators for the unneeded additional load on the puppet masters.
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.
Agreed we should not use the generator function.
6c715b9
to
37f22ac
Compare
Manual workaround for puppetserver versions >= 2.5.0 that use /etc/puppetlabs/puppetserver/services.d/ca.cfg for bootstrap configuration. Check links for more info https://puppet.com/docs/puppetserver/2.7/release_notes.html#potential-breaking-issues-when-upgrading-with-a-modified-bootstrapcfg https://puppet.com/docs/puppetserver/2.7/release_notes.html#new-feature-flexible-service-bootstrappingca-configuration-file
37f22ac
to
33820ee
Compare
A better way would be to add a puppetserver version parameter for the user to choose the installed puppetserver version. As default it could test if $puppetserver::version contains a version string and re-use that if true. Unsure what the fallback default should be if $puppetserver::version contains a text string. This approach would break backward compatibility. |
Manual workaround for puppetserver versions >= 2.5.0 that use
/etc/puppetlabs/puppetserver/services.d/ca.cfg for bootstrap configuration.
Check links for more info
https://puppet.com/docs/puppetserver/2.7/release_notes.html#potential-breaking-issues-when-upgrading-with-a-modified-bootstrapcfg
https://puppet.com/docs/puppetserver/2.7/release_notes.html#new-feature-flexible-service-bootstrappingca-configuration-file
fixes #52