community.windows icon indicating copy to clipboard operation
community.windows copied to clipboard

New win_capability module

Open RRohi opened this issue 3 years ago • 4 comments

SUMMARY

Would be nice if there was a module to configure (enable/disable) Windows Capabilities, similar to win_optional_feature module.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

I guess the new module's name would be win_capability?

ADDITIONAL INFORMATION

The module would replicate the functionality of the cmdlets found via this query:

Get-Command -Module Dism -Noun WindowsCapability

It would allow people to enable, or disable Windows Capabilities, along with Optional Features and Features (on Servers).

Since Capabilities have version numbers in their names, we should be able to use wildcards or provide names partially.

Below is an example of how I would add RSAT Windows Capabilities with PowerShell and a mockup of an Ansible task where I would disable a couple of Capabilities that are enabled by default.

Get-WindowsCapability -Online -Name Rsat.* | Add-WindowsCapability -Online
- name: Disable unnecessary Windows Capabilities
  community.windows.win_capability:
    name: "{{ item }}"
    state: absent
  loop:
    - 'XPS.Viewer'
    - 'App.Support.QuickAssist'
    - 'Browser.InternetExplorer'

RRohi avatar Jul 08 '21 22:07 RRohi

In my opinion, this capability is needed to enable ssh server for windows!

xhiroga avatar May 01 '22 05:05 xhiroga

Same here. I need it to install the OpenSSH.Server "optional feature".

smatterchew avatar May 31 '22 20:05 smatterchew

+1 from me. Same use case as @smatterchew.

mkjpryor avatar Jun 16 '22 11:06 mkjpryor

+1

sei-dspooner avatar Aug 09 '22 18:08 sei-dspooner

+1

julmb avatar Feb 08 '23 15:02 julmb

+1

bmbufalo avatar Apr 10 '23 18:04 bmbufalo

please for the love of all things ansible

the-nurk avatar May 03 '23 15:05 the-nurk

As per the README https://github.com/ansible-collections/community.windows#contributing-to-this-collection this collection is currently only accepting bugfixes or features to existing modules.

jborean93 avatar May 29 '23 04:05 jborean93

As this issue has been closed, can https://github.com/ansible-collections/ansible.windows/issues/96 be reopened?

aristotelos avatar Apr 10 '24 08:04 aristotelos