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

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

Open
Phil-Friderici wants to merge 1 commit into
voxpupuli:masterfrom
Phil-Friderici:fix_target
Open

Parameterize targetfile in puppetserver::config::bootstrap#54
Phil-Friderici wants to merge 1 commit into
voxpupuli:masterfrom
Phil-Friderici:fix_target

Conversation

@Phil-Friderici

Copy link
Copy Markdown
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

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

@ghoneycutt ghoneycutt Feb 15, 2018

Copy link
Copy Markdown
Member

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.

@Phil-Friderici Phil-Friderici Feb 15, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

comment added

Comment thread README.md
}
```

A Puppetserver >= 2.5.0 ca.cfg entry.

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

@Phil-Friderici Phil-Friderici Feb 15, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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.

@ghoneycutt ghoneycutt Feb 15, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
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