| Puppet Version: 5.5.14 Puppet Server Version: 2.8.x OS Name/Version: Windows While writing a class to install VisualStudio 2019 I found that the Windows package provider doesn't support the reinstallable feature. The VisualStudio installer can install user defined subsets of VS components (called workloads), which can be specified on the command line. Thus, the package should be reinstalled when the list of workloads changes, like for example:
# Create a trigger file containing the list of workloads |
file {'C:/ProgramData/Puppet/VisualStudio/2019/Workloads': |
ensure => present, |
content => $workloads, |
} |
~> |
package { 'Visual Studio Enterprise 2019': |
source => $vs_pkg, |
ensure => present, |
install_options => [ |
'modify', |
'--add', |
$workloads, |
'--norestart', |
'--productKey', |
$product_key, |
'--quiet', |
'--wait', |
], |
require => File['vs_pkg'], |
} |
The installer can also be controlled with an input file, which means the package should be reinstalled whenever that changes. |