iis icon indicating copy to clipboard operation
iis copied to clipboard

Allow install resource to take an optional parameter to control the windows feature install method

Open dave-q opened this issue 3 years ago • 1 comments

:person_frowning: Problem Statement

Using the IIS cookbook within my own cookbooks I would like to control the install method for any windows features that are installed by the IIS cookbook

:grey_question: Possible Solution

The windows_feature resource already exposes this functionality https://docs.chef.io/resources/windows_feature/

install_method Ruby Type: Symbol | Default Value: :windows_feature_dism Allowed Values: :windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd The underlying installation method to use for feature installation. Specify :windows_feature_dism for DISM or :windows_feature_powershell for PowerShell.

I think it would be simple enough to expose a similar parameter on the install resource. It would be required false for backwards compatibility and to allow the windows_feature resource to take control of defaulting the value.

This can then be set in default.rb recipe from a node attribute, that way it can be controlled by downstream users of the cookbook.

I would suggest also exposed an optiona paramater on the manager.rb resource as this calls into the install resource

:arrow_heading_up: Describe alternatives you've considered

I can't really think of any alternatives, currently there is no way of me controlling how the windows features in this cookbook are installed

:heavy_plus_sign: Additional context

We came across this issue as some of our infrastructure is running some chef recipes via a JEA profile, which is restricting the ability to run dism commands

dave-q avatar Apr 01 '21 08:04 dave-q

I'm happy to put in a PR for this myself :)

dave-q avatar Apr 01 '21 08:04 dave-q