Skip to content

Commit

Permalink
(MODULES-7042) Fix $chocolatey_version parameter
Browse files Browse the repository at this point in the history
Fixes $chocolatey_version to acually bootstrap the given version of
chocolatey.
  • Loading branch information
helge000 committed Apr 25, 2018
1 parent e3dcf51 commit a91f6d0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
class chocolatey::install {
assert_private()

$download_url = $::chocolatey::chocolatey_download_url
$unzip_type = $::chocolatey::use_7zip ? {
$_download_url = $::chocolatey::chocolatey_download_url
$chocolatey_version = $::chocolatey::chocolatey_version
$unzip_type = $::chocolatey::use_7zip ? {
true => '7zip',
default => 'windows'
}

if "${_download_url}" =~ /^http(s):\/\/.*api\/v2\/package.*\/$/ and "${chocolatey_version}" =~ /\d+\./ {
# Assume a nuget server source and we want to download a specific version instead the most current
$download_url = "${_download_url}${chocolatey_version}"
} else {
$download_url = $_download_url
}

registry_value { 'ChocolateyInstall environment value':
ensure => present,
path => 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\ChocolateyInstall',
Expand Down

0 comments on commit a91f6d0

Please sign in to comment.