Skip to content
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

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

Open
dave-q opened this issue Apr 1, 2021 · 1 comment
Labels
Feature Request Enhancement to existing functionality or new functionality

Comments

@dave-q
Copy link
Contributor

dave-q commented Apr 1, 2021

: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

❔ 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

⤴️ 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

➕ 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 dave-q added the Feature Request Enhancement to existing functionality or new functionality label Apr 1, 2021
@dave-q
Copy link
Contributor Author

dave-q commented Apr 1, 2021

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

dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
if the node is present its value is passed into any windows_feature
resources as the install_method property

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
if the node is present its value is passed into any windows_feature
resources as the install_method property

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
if the node is present its value is passed into any windows_feature
resources as the install_method property

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
if the node is present its value is passed into any windows_feature
resources as the install_method property

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
- Fixes Kitchen.yaml formatting error
- 'install' and 'manage' resources correctly define install_method property
as being a Symbol type and then specify the valid symbols
- iis -> windows_feature_install_method attribute is now defaulted
to the default value that windows_feature uses which is :windows_feature_dism
- Change log entry added
- Updates documentation for 'install' and 'managed' resources
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
- Fixes Kitchen.yaml formatting error
- 'install' and 'manage' resources correctly define install_method property
as being a Symbol type and then specify the valid symbols
- iis -> windows_feature_install_method attribute is now defaulted
to the default value that windows_feature uses which is :windows_feature_dism
- Change log entry added
- Updates documentation for 'install' and 'managed' resources

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
- Fixes Kitchen.yaml formatting error
- 'install' and 'manage' resources correctly define install_method property
as being a Symbol type and then specify the valid symbols
- iis -> windows_feature_install_method attribute is now defaulted
to the default value that windows_feature uses which is :windows_feature_dism
- Change log entry added
- Updates documentation for 'install' and 'managed' resources

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
- Fixes Kitchen.yaml formatting error
- 'install' and 'manage' resources correctly define install_method property
as being a Symbol type and then specify the valid symbols
- iis -> windows_feature_install_method attribute is now defaulted
to the default value that windows_feature uses which is :windows_feature_dism
- Change log entry added
- Updates documentation for 'install' and 'managed' resources
- Usage of new attribute is done with a coercion to a symbol

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…is is part of the inspec tests

- The inspec verifier for the site suite expects the ftp site to be running
however the action start is not specified. How these tests passed before I'm
not sure
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 1, 2021
…en install method is powershell

- Using powershell to install features requires passing in a different feature name
- To prevent having to do this look up for every windows_feature call
I created a wrapper resource that is identical to windows_feature expect
it will look up the correct  format of the feature to install

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 2, 2021
dave-q added a commit to dave-q/iis that referenced this issue Apr 2, 2021
dave-q added a commit to dave-q/iis that referenced this issue Apr 2, 2021
dave-q added a commit to dave-q/iis that referenced this issue Apr 12, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 12, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 13, 2021
…ws_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
dave-q added a commit to dave-q/iis that referenced this issue Apr 15, 2021
…ws_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource
dave-q added a commit to dave-q/iis that referenced this issue Apr 15, 2021
…ws_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource
dave-q added a commit to dave-q/iis that referenced this issue Apr 15, 2021
…ws_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource
dave-q added a commit to dave-q/iis that referenced this issue Apr 15, 2021
…ws_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource
dave-q added a commit to dave-q/iis that referenced this issue Apr 15, 2021
…ws_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource
dave-q added a commit to dave-q/iis that referenced this issue Apr 25, 2021
dave-q added a commit to dave-q/iis that referenced this issue Apr 25, 2021
damacus added a commit to dave-q/iis that referenced this issue Feb 15, 2022
damacus added a commit to dave-q/iis that referenced this issue Oct 3, 2023
damacus added a commit that referenced this issue Oct 3, 2023
#477)

* [GH-476] Allow specifying install method for internal windows_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>

* [GH-476] Allow specifying install method for internal windows_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource

* Update README.md

Co-authored-by: Jason Field <Jason@avon-lea.co.uk>

* [GH-476] Raise an error if the feature name cannot be translated

---------

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
Co-authored-by: Jason Field <Jason@avon-lea.co.uk>
Co-authored-by: Dan Webb <dan.webb@damacus.io>
rjhornsby pushed a commit to Sev1Tech/iis that referenced this issue Oct 3, 2023
…e resources (sous-chefs#477)

* [sous-chefsGH-476] Allow specifying install method for internal windows_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>

* [sous-chefsGH-476] Allow specifying install method for internal windows_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource

* Update README.md

Co-authored-by: Jason Field <Jason@avon-lea.co.uk>

* [sous-chefsGH-476] Raise an error if the feature name cannot be translated

---------

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
Co-authored-by: Jason Field <Jason@avon-lea.co.uk>
Co-authored-by: Dan Webb <dan.webb@damacus.io>
rjhornsby added a commit to Sev1Tech/iis that referenced this issue Oct 3, 2023
Set Changelog to ## Unreleased

Update sous-chefs/.github action to v2.0.6 (sous-chefs#516)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update changelog for 8.0.20

Update metadata for 8.0.20

Set Changelog to ## Unreleased

fix bug with setting no_managed_code

Signed-off-by jmschu02@gmail.com

**Description**
had to recreate
Fixes a bug in iis_pool that causes an issue with resetting to no_managed_code runtime versions

**Issues Resolved**

**Check List**
  All tests pass. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD
  New functionality includes testing.
  New functionality has been documented in the README if applicable
  All commits have been signed for the Developer Certificate of Origin. See https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

[sous-chefsGH-476] Allow specifying install method for windows_feature resources (sous-chefs#477)

* [sous-chefsGH-476] Allow specifying install method for internal windows_feature resources

- Introduces new attribute ['iis']['windows_feature_install_method']
the value of this vode is passed to any calls to the windows_feature resource
as the resources install_method property

- feature names are translated into powershell format when install
method is powershell

  - Using powershell to install features requires passing in a
    different feature name
  - added library method to translate any feature names into the powershell
    format if the install mode is powershell
  - the look up handles the scenario where someone has already
    provided the feature name in the powershell format

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>

* [sous-chefsGH-476] Allow specifying install method for internal windows_feature resources

install resource refactored to do the feature name translation if required
by just adding the helper method in the action_class.

Also refactored the install resource to enable and start the W3WVC service
since every other recipe in the cookbook used to call the default recipe
that did that anyway

starting the W3WVC is optional and defaults to false, so that the
current behaviour of that resource that doesn't change for down stream users

This makes a much cleaner implemenation, no helper module monkey patched
into recipe, no extra resources and to all users of the cookbook there are
no breaking changes just new options if desired.

Added a unit test for all the mod recipes just to check they converge,
I think this just gives some confidence things are breaking

Spec tests for the install resource

* Update README.md

Co-authored-by: Jason Field <Jason@avon-lea.co.uk>

* [sous-chefsGH-476] Raise an error if the feature name cannot be translated

---------

Signed-off-by: dave-q <24652224+dave-q@users.noreply.github.com>
Co-authored-by: Jason Field <Jason@avon-lea.co.uk>
Co-authored-by: Dan Webb <dan.webb@damacus.io>

Update changelog for 8.1.0

Update metadata for 8.1.0

Set Changelog to ## Unreleased

Allow pool recycle after N requests

Add inspec test

Update changelog for 8.1.0

Update metadata for 8.1.0

Set Changelog to ## Unreleased
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Enhancement to existing functionality or new functionality
Projects
None yet
Development

No branches or pull requests

1 participant