Details
-
Bug
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
Windows
-
Needs Assessment
-
Needs Assessment
Description
Certain applications like the dotnetcore-runtime and dotnetcore-sdk are able to be installed on a system in a side-by-side fashion. Unfortunately this module has no way to handle this scenario and is also noted in the documentation under the "known issues" section ( https://github.com/puppetlabs/puppetlabs-chocolatey#known-issues ).
So for example if i want to ensure 2 different version of the dotnetcore-sdk are installed and managed on my machine via puppet, attempting to use the following code below gives a duplicate resource exception:
package { 'dotnetcore-sdk': |
ensure => '2.2.0', |
provider => chocolatey,
|
}
|
package { 'dotnetcore-sdk': |
ensure => '2.1.4', |
provider => chocolatey,
|
}
|
|
It would be awesome if there is some attribute that could be added like side_by_side. It would default to false but could be set to true. When set to true it would take the name of each package and append the version number to it. For Example:
package {'dotnetcore-sdk': |
ensure => '2.2.0', |
side_by_side => true, |
provider => chocolatey,
|
}
|
|
package { 'dotnetcore-sdk': |
ensure => '2.1.4', |
side_by_side => true, |
provider => chocolatey,
|
}
|
There would also need to be some error checking so that if one package name is specified as a side_by_side package all other packages using the same name must have this attribute set to true as well or something.
Anyone have any thoughts on if this is possible to implement and do?
As a side note, I also attempted to try this which should work based on how other package providers work but the chocolatey provider doesn't.
|
package {'dotnetcore-sdk-2.2.0': |
name => 'dotnetcore-sdk' |
ensure => '2.2.0', |
provider => chocolatey,
|
}
|
|
package {'dotnetcore-sdk-2.1.4': |
name => 'dotnetcore-sdk' |
ensure => '2.1.4', |
provider => chocolatey,
|
}
|
The error returned is the following
Error: Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Package[dotnetcore-sdk-2.1.4] to ["do |
tnetcore-sdk", "chocolatey"] at (file: C:/Users/vagrant/Desktop/site.pp.txt, line: 7); resource ["Package", "dotnetcore- |
sdk", "chocolatey"] already declared (file: C:/Users/vagrant/Desktop/site.pp.txt, line: 1) (file: C:/Users/vagrant/Deskt |
op/site.pp.txt, line: 7, column: 1) on node win-uva8ipmfmfr |