ansible.windows.win_partition_info module – Gather information about Windows disk partitions
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_partition_info.
New in ansible.windows 3.10.0
Synopsis
Gather information about all partitions or partitions matching the specified filters.
Parameters
Parameter |
Comments |
|---|---|
Return partitions on this disk. Disk numbers start at |
|
Return the partition with this drive letter. This option is mutually exclusive with disk_number and partition_number. |
|
Return partitions with this partition number. Can be used by itself to search all disks or together with disk_number to identify a partition. Partition numbers start at |
Notes
Note
Requires Windows 8 or Windows Server 2012 (NT 6.2) or newer.
See Also
See also
- ansible.windows.win_partition
Creates, changes and removes partitions on Windows Server.
Examples
- name: Get information about all partitions
ansible.windows.win_partition_info:
register: partition_info
- name: Get information about a partition by disk and partition number
ansible.windows.win_partition_info:
disk_number: 1
partition_number: 2
register: partition_info
- name: Get information about the partition with drive letter D
ansible.windows.win_partition_info:
drive_letter: D
register: partition_info
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether any partitions were found with the specified filters. Returned: always Sample: |
|
Information about each matching partition. This will be an empty list when no partitions match the specified filters. Returned: always |
|
Access paths for the partition, including drive letters and mounted folders. Returned: success |
|
Number of the disk containing the partition. Returned: success Sample: |
|
Drive letter assigned to the partition, or Returned: success Sample: |
|
GPT type GUID, or Returned: success Sample: |
|
GUID of the partition, or Returned: success Sample: |
|
Whether the partition is active. This property is only applicable to MBR disks. Returned: success Sample: |
|
Whether the partition is the current boot partition. Returned: success Sample: |
|
Whether the partition is hidden from the mount manager. Returned: success Sample: |
|
Whether the partition is offline. Returned: success Sample: |
|
Whether the partition is read-only. Returned: success Sample: |
|
Whether the partition is a shadow copy of another partition. Returned: success Sample: |
|
Whether the partition is a system partition. Returned: success Sample: |
|
MBR partition type code, or Returned: success Sample: |
|
Whether Windows avoids assigning a drive letter automatically to this partition. Returned: success Sample: |
|
Starting offset of the partition in bytes. Returned: success Sample: |
|
Numeric operational status reported for the partition. Returned: success Sample: |
|
Number of the partition on its disk. Returned: success Sample: |
|
Size of the partition in bytes. Returned: success Sample: |
|
Numeric transition state reported for the partition. Returned: success Sample: |
|
Partition type reported by the Windows Storage module. Returned: success Sample: |