ansible.windows.win_format_info module – Gather information about Windows volumes
Note
This module is part of the ansible.windows collection (version 3.9.1).
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.
To use it in a playbook, specify: ansible.windows.win_format_info.
New in ansible.windows 3.10.0
Synopsis
Gathers information about existing volumes on Windows.
A volume can be selected by drive letter, path, or file system label.
If no selector is specified, information about all volumes is returned.
Parameters
Parameter |
Comments |
|---|---|
The drive letter of the volume to query. Specify a single letter without a colon. Mutually exclusive with path and label. |
|
The file system label of the volume or volumes to query. Mutually exclusive with drive_letter and path. |
|
The path of the volume to query. Mutually exclusive with drive_letter and label. |
Notes
Note
Requires Windows Server 2016 or newer with the Storage PowerShell module.
If no volumes match the selector,
existsisfalseandvolumesis an empty list.If multiple volumes have the same label, all matching volumes are returned.
See Also
See also
- ansible.windows.win_format
Formats an existing volume or a new volume on an existing partition on Windows.
Examples
- name: Gather information about all volumes
ansible.windows.win_format_info:
register: all_volumes
- name: Gather information about a volume by drive letter
ansible.windows.win_format_info:
drive_letter: D
register: d_volume
- name: Gather information about a volume by path
ansible.windows.win_format_info:
path: "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\"
register: selected_volume
- name: Gather information about all volumes with a file system label
ansible.windows.win_format_info:
label: Data
register: data_volumes
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether any matching volumes were found. Returned: always Sample: |
|
Volumes matching the specified criteria, or all volumes when no selector is provided. Returned: always |
|
Allocation unit size of the volume in bytes, or null when it is unavailable. Returned: always Sample: |
|
Drive letter assigned to the volume, or null if it has no drive letter. Returned: always Sample: |
|
Type of the volume drive. Returned: always Sample: |
|
File system of the volume, or an empty string if it is not formatted. Returned: always Sample: |
|
File system label of the volume, or an empty string if no label is set. Returned: always Sample: |
|
Health status reported for the volume. Returned: always Sample: |
|
Operational status values reported for the volume. Returned: always Sample: |
|
Path used to identify the volume. Returned: always Sample: |
|
Total size of the volume in bytes. Returned: always Sample: |
|
Remaining capacity of the volume in bytes. Returned: always Sample: |