Open alexberry opened 4 years ago
Looks like the puppetlabs-managed version of this module manages this already: https://github.com/puppetlabs/puppetlabs-chocolatey/blob/master/templates/InstallChocolatey.ps1.erb#L70-L78
TLDR switch to puppetlabs' module at your earliest convenience!
Older versions of powershell 5.1 do not negotiate tls versions, chocolatey.org recently disabled tls 1 and this broke their install script. Your puppet run will produce an error something like:
The right way to fix this is to patch your servers, the wrong way to do it is to borrow my fix in the interim:
https://github.com/alexberry/puppet-chocolatey/releases/tag/1.2.6-pwsh-workaround
Forked from this module, based on latest tag, a two line patch that upgrades the tls version used by powershell ahead of the request. The setting is transient and only good for that shell, so should have no further ill effect.
You can include it in your Puppetfile as follows, first remove the chocolatey-chocolatey module from your Puppetfile:
Then add in this module:
Or, better yet, fork this module yourself, then save the following patch as
workaround.patch
:Patch it as follows:
And then make the same Puppetfile changes as above, substituting in the url to your fork.
Not adding a pull request as this is an archived module, should really use puppetlabs-chocolatey instead, although a similar workaround may be needed there too.