Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Parameterize targetfile in puppetserver::config::bootstrap #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Phil-Friderici
Copy link
Contributor

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

} else {
$targetfile = '/etc/puppetserver/bootstrap.cfg'
if versioncmp($::puppetversion, '4.0.0') >= 0 {
Copy link
Member

@ghoneycutt ghoneycutt Feb 15, 2018

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.

Copy link
Contributor Author

@Phil-Friderici Phil-Friderici Feb 15, 2018

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

Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor Author

@Phil-Friderici Phil-Friderici Feb 15, 2018

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.

Copy link
Contributor Author

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.

Copy link
Member

@ghoneycutt ghoneycutt Feb 15, 2018

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.

@Phil-Friderici
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$targetfile in puppetserver::config::bootstrap doesn't respect puppetserver 5.1.x
2 participants