ansible.windows.win_capability_info module – Get information about Windows capabilities

Note

This module is part of the ansible.windows collection (version 3.6.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ansible.windows. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: ansible.windows.win_capability_info.

New in ansible.windows 3.6.0

Synopsis

  • Gather information about Windows capabilities.

  • A Windows capability is an optional feature that can be added to Windows.

Requirements

The below requirements are needed on the host that executes this module.

  • Windows Server 2019/Windows 10 build 1809 or newer for PowerShell 5.1

  • Windows Server 2022/Windows 10 build 1903 or newer for PowerShell 7.x

Parameters

Parameter

Comments

disable_windows_update

boolean

If true, prevents DISM from contacting Windows Update for the source files.

Choices:

  • false ← (default)

  • true

log_level

integer

Sets the maximum output level for DISM logging.

0 logs errors only

1 logs errors and warnings

2 logs errors, warnings, and information

3 logs all of the previous plus debug output.

This log is managed by DISM itself, the values allowed may change with different versions of Windows.

log_path

path

Specifies the full path and file name to log to.

If not specified the logging uses the default DISM log file location which is %WINDIR%\Logs\Dism\dism.log.

name

list / elements=string

A list of capability names to filter by.

Supports wildcard patterns like ? for single character matching and * for multiple character matching.

If not specified, all capabilities will be returned.

source

list / elements=string

Finds capabilities that are available in the specified source locations.

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.

diff_mode

Support: N/A

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode

platform

Platform: windows

Target OS/families that can be operated against

Notes

Note

  • This module does not support Server 2016.

See Also

See also

ansible.windows.win_capability

Manage Windows capabilities.

Examples

- name: Get all capabilities
  ansible.windows.win_capability_info:
  register: capability_info

- name: Get specific capability using full name
  ansible.windows.win_capability_info:
    name: OpenSSH.Client~~~~0.0.1.0
  register: ssh_client_info

- name: Get capabilities matching a pattern
  ansible.windows.win_capability_info:
    name:
      - OpenSSH.*
      - Language.Basic*
  register: filtered_capabilities

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

capabilities

list / elements=dictionary

A list of capabilities found.

Returned: always

description

string

The description of the capability.

Returned: always

Sample: "OpenSSH-based secure shell (SSH) client, for secure key management and access to remote machines."

display_name

string

The display name of the capability.

Returned: always

Sample: "OpenSSH Client"

download_size

integer

The download size of the capability in bytes.

Returned: always

Sample: 1048576

install_size

integer

The installation size of the capability in bytes.

Returned: always

Sample: 2097152

name

string

The name of the capability.

Returned: always

Sample: "OpenSSH.Client~~~~0.0.1.0"

state

string

The installation state of the capability.

Known values are NotPresent, UninstallPending, Staged, Resolved, Installed, InstallPending, Superseded, and PartiallyInstalled.

Returned: always

Sample: "Installed"

Authors

  • Jordan Borean (@jborean93)