Switch cache type on client version #328
Open
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the change introduced in #312 this
module switches the fact cache type if the puppetserver it's running
against is v7 or greater; in that situation it will use the puppetserver
v7 default of
json
for the fact cache format.Unfortunately this opens up the possibility that while the server a
puppet-agent is running against might be v7, the agent and the server it's
running to configure might not be. Specifically, we hit a situation
where a server hosting puppetserver 5 was running puppet-agent against
another puppetserver on version 7 (this was for the purposes of a
version rollout), with the result that this module configured the
puppetserver v5 with a fact cache format of
json
, signalling thepuppetserver v5 to restart and meaning it failed during startup.
I think the intention of the original change was to switch its behaviour
based on the version of puppetserver it's configuring, and not
necessarily the version of puppetserver it's running against. Given the
puppetserver compatibility requirements I believe it's safe to use the
puppet-agent version as an analogue for the local puppetserver version,
so here I'm using the
clientversion
fact to replaceserverversion
.