-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-4091) Explicitly Set ChocolateyInstall Environment #53
(MODULES-4091) Explicitly Set ChocolateyInstall Environment #53
Conversation
When looking at determining the version of Chocolatey for configuration purposes in config.pp, determine if the value of `$chocolatey::chocolatey_version` is coming back undefined. If it is, return a string with 0 as the value. Add a local variable to make that determination and use it instead of the fact in the versioncmp checks.
| # lint:ignore:80chars | ||
| if versioncmp($chocolatey::chocolatey_version, '0.9.9.0') >= 0 and versioncmp($chocolatey::chocolatey_version, '0.9.10.0') < 0 { | ||
| if versioncmp($_choco_version, '0.9.9.0') >= 0 and versioncmp($_choco_version, '0.9.10.0') < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny annoyance fixed as an additional maint commit.
| exec { 'install_chocolatey_official': | ||
| command => template('chocolatey/InstallChocolatey.ps1.erb'), | ||
| creates => "${::chocolatey::choco_install_location}\\bin\\choco.exe", | ||
| provider => powershell, | ||
| timeout => $::chocolatey::choco_install_timeout_seconds, | ||
| logoutput => $::chocolatey::log_output, | ||
| environment => ["ChocolateyInstall=${::chocolatey::choco_install_location}"] | ||
| environment => ["ChocolateyInstall=${::chocolatey::choco_install_location}"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not removing this in hopes that it will still get fixed.
| ensure => present, | ||
| path => 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\ChocolateyInstall', | ||
| type => 'string', | ||
| data => $chocolatey::choco_install_location, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this needs quoted in case it has spaces.
Previously, ensuring the installation directory for Chocolatey keyed off of an environment value passed to an exec powershell resource through the environment parameter. However there is a bug in the powershell module in versions 2.x up to 2.1.0 (current version as of this commit) that ignore the environment parameter. Since it is better to explicitly set that value, take a dependency on the registry module and explicitly ensure the environment variable is set so that Chocolatey will successfully install to an alternative install location.
8d2f40f
to
c760fb6
Compare
Added in meta data for numerous QA modules
Previously, ensuring the installation directory for Chocolatey
keyed off of an environment value passed to an exec powershell
resource through the environment parameter. However there is a
bug in the powershell module in versions 2.x up to 2.1.0
(current version as of this commit) that ignore the environment
parameter. Since it is better to explicitly set that value, take
a dependency on the registry module and explicitly ensure the
environment variable is set so that Chocolatey will successfully
install to an alternative install location.