@ -16,7 +16,7 @@ version_added: '2.5'
short_description : Show the attached disks and disk information of the target host
short_description : Show the attached disks and disk information of the target host
description :
description :
- With the module you can retrieve and output detailed information about the attached disks of the target and
- With the module you can retrieve and output detailed information about the attached disks of the target and
it ' s volumes and partitions if existent.
it s volumes and partitions if existent .
requirements :
requirements :
- Windows 8.1 / Windows 2012 ( NT 6.2 )
- Windows 8.1 / Windows 2012 ( NT 6.2 )
author :
author :
@ -27,15 +27,29 @@ notes:
'''
'''
EXAMPLES = r '''
EXAMPLES = r '''
- name : g et disk facts
- name : G et disk facts
win_disk_facts :
win_disk_facts :
- name : output first disk size
- name : Output first disk size
debug :
debug :
var : ansible_facts . disks [ 0 ] . size
var : ansible_facts . disks [ 0 ] . size
- name : get disk facts
- name : Convert first system disk into various formats
win_disk_facts :
debug :
- name : output second disk serial number
msg : ' {{ disksize_gib }} vs {{ disksize_gib_human }} '
vars :
# Get first system disk
disk : ' {{ ansible_facts.disks|selectattr( " system_disk " )|first }} '
# Show disk size in Gibibytes
disksize_gib_human : ' {{ disk.size|filesizeformat(True) }} ' # returns "223.6 GiB" (human readable)
disksize_gib : ' {{ (disk.size/1024|pow(3))|round|int }} GiB ' # returns "224 GiB" (value in GiB)
# Show disk size in Gigabytes
disksize_gb_human : ' {{ disk.size|filesizeformat }} ' # returns "240.1 GB" (human readable)
disksize_gb : ' {{ (disk.size/1000|pow(3))|round|int }} GB ' # returns "240 GB" (value in GB)
- name : Output second disk serial number
debug :
debug :
var : ansible_facts . disks [ 0 ] . serial_number
var : ansible_facts . disks [ 0 ] . serial_number
'''
'''
@ -46,12 +60,7 @@ ansible_facts:
returned : always
returned : always
type : complex
type : complex
contains :
contains :
total_disks :
ansible_disks :
description : Count of found disks on the target .
returned : if disks were found
type : int
sample : 3
disks :
description : Detailed information about one particular disk .
description : Detailed information about one particular disk .
returned : if disks were found
returned : if disks were found
type : list
type : list
@ -62,10 +71,10 @@ ansible_facts:
type : int
type : int
sample : 0
sample : 0
size :
size :
description : Size in Gibibyte of the particular disk .
description : Size in bytes of the particular disk .
returned : always
returned : always
type : string
type : int
sample : " 100GiB "
sample : 227727638528
bus_type :
bus_type :
description : Bus type of the particular disk .
description : Bus type of the particular disk .
returned : always
returned : always
@ -92,30 +101,30 @@ ansible_facts:
type : string
type : string
sample : " Online "
sample : " Online "
sector_size :
sector_size :
description : Sector size in byte of the particular disk .
description : Sector size in bytes of the particular disk .
returned : always
returned : always
type : string
type : int
sample : " 512s/byte/bytes/ "
sample : 4096
read_only :
read_only :
description : Read only status of the particular disk .
description : Read only status of the particular disk .
returned : always
returned : always
type : string
type : bool
sample : " true "
sample : True
bootable :
bootable :
description : Information whether the particular disk is a bootable disk .
description : Information whether the particular disk is a bootable disk .
returned : always
returned : always
type : string
type : bool
sample : " false "
sample : False
system_disk :
system_disk :
description : Information whether the particular disk is a system disk .
description : Information whether the particular disk is a system disk .
returned : always
returned : always
type : string
type : bool
sample : " true "
sample : True
clustered :
clustered :
description : Information whether the particular disk is clustered ( part of a failover cluster ) .
description : Information whether the particular disk is clustered ( part of a failover cluster ) .
returned : always
returned : always
type : string
type : bool
sample : " false "
sample : False
manufacturer :
manufacturer :
description : Manufacturer of the particular disk .
description : Manufacturer of the particular disk .
returned : always
returned : always
@ -168,11 +177,10 @@ ansible_facts:
sample : 1
sample : 1
size :
size :
description :
description :
- Size in Gibibyte of the particular partition .
- Size in bytes of the particular partition .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 0.031GiB "
sample : 838860800
type :
type :
description : Type of the particular partition .
description : Type of the particular partition .
returned : always
returned : always
@ -186,8 +194,8 @@ ansible_facts:
no_default_driveletter :
no_default_driveletter :
description : Information whether the particular partition has a default drive letter or not .
description : Information whether the particular partition has a default drive letter or not .
returned : if partition_style property of the particular disk has value " GPT "
returned : if partition_style property of the particular disk has value " GPT "
type : string
type : bool
sample : " true "
sample : True
mbr_type :
mbr_type :
description : mbr type of the particular partition .
description : mbr type of the particular partition .
returned : if partition_style property of the particular disk has value " MBR "
returned : if partition_style property of the particular disk has value " MBR "
@ -196,8 +204,8 @@ ansible_facts:
active :
active :
description : Information whether the particular partition is an active partition or not .
description : Information whether the particular partition is an active partition or not .
returned : if partition_style property of the particular disk has value " MBR "
returned : if partition_style property of the particular disk has value " MBR "
type : string
type : bool
sample : " true "
sample : True
drive_letter :
drive_letter :
description : Drive letter of the particular partition .
description : Drive letter of the particular partition .
returned : if existent
returned : if existent
@ -216,13 +224,13 @@ ansible_facts:
hidden :
hidden :
description : Information whether the particular partition is hidden or not .
description : Information whether the particular partition is hidden or not .
returned : always
returned : always
type : string
type : bool
sample : " true "
sample : True
shadow_copy :
shadow_copy :
description : Information whether the particular partition is a shadow copy of another partition .
description : Information whether the particular partition is a shadow copy of another partition .
returned : always
returned : always
type : string
type : bool
sample : " false "
sample : False
guid :
guid :
description : GUID of the particular partition .
description : GUID of the particular partition .
returned : if existent
returned : if existent
@ -240,18 +248,16 @@ ansible_facts:
contains :
contains :
size :
size :
description :
description :
- Size in Gibibyte of the particular volume .
- Size in bytes of the particular volume .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 0,342GiB "
sample : 838856704
size_remaining :
size_remaining :
description :
description :
- Remaining size in Gibibyte of the particular volume .
- Remaining size in bytes of the particular volume .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 0,146GiB "
sample : 395620352
type :
type :
description : File system type of the particular volume .
description : File system type of the particular volume .
returned : always
returned : always
@ -273,10 +279,10 @@ ansible_facts:
type : string
type : string
sample : " Fixed "
sample : " Fixed "
allocation_unit_size :
allocation_unit_size :
description : Allocation unit size in Kibibyte of the particular volume .
description : Allocation unit size in bytes of the particular volume .
returned : always
returned : always
type : string
type : int
sample : " 64KiB "
sample : 4096
object_id :
object_id :
description : Object ID of the particular volume .
description : Object ID of the particular volume .
returned : always
returned : always
@ -299,18 +305,16 @@ ansible_facts:
sample : " UnSpecified "
sample : " UnSpecified "
size :
size :
description :
description :
- Size in Gibibyte of the particular physical disk .
- Size in bytes of the particular physical disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 200GiB "
sample : 240057409536
allocated_size :
allocated_size :
description :
description :
- Allocated size in Gibibyte of the particular physical disk .
- Allocated size in bytes of the particular physical disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 100GiB "
sample : 240057409536
device_id :
device_id :
description : Device ID of the particular physical disk .
description : Device ID of the particular physical disk .
returned : always
returned : always
@ -359,8 +363,8 @@ ansible_facts:
spindle_speed :
spindle_speed :
description : Spindle speed in rpm of the particular physical disk .
description : Spindle speed in rpm of the particular physical disk .
returned : always
returned : always
type : string
type : int
sample : " 4294967295rpm "
sample : 4294967295
physical_location :
physical_location :
description : Physical location of the particular physical disk .
description : Physical location of the particular physical disk .
returned : always
returned : always
@ -379,8 +383,8 @@ ansible_facts:
can_pool :
can_pool :
description : Information whether the particular physical disk can be added to a storage pool .
description : Information whether the particular physical disk can be added to a storage pool .
returned : always
returned : always
type : string
type : bool
sample : " false "
sample : False
cannot_pool_reason :
cannot_pool_reason :
description : Information why the particular physical disk can not be added to a storage pool .
description : Information why the particular physical disk can not be added to a storage pool .
returned : if can_pool property has value false
returned : if can_pool property has value false
@ -389,13 +393,13 @@ ansible_facts:
indication_enabled :
indication_enabled :
description : Information whether indication is enabled for the particular physical disk .
description : Information whether indication is enabled for the particular physical disk .
returned : always
returned : always
type : string
type : bool
sample : " True "
sample : True
partial :
partial :
description : Information whether the particular physical disk is partial .
description : Information whether the particular physical disk is partial .
returned : always
returned : always
type : string
type : bool
sample : " False "
sample : False
serial_number :
serial_number :
description : Serial number of the particular physical disk .
description : Serial number of the particular physical disk .
returned : always
returned : always
@ -418,25 +422,22 @@ ansible_facts:
contains :
contains :
size :
size :
description :
description :
- Size in Gibibyte of the particular virtual disk .
- Size in bytes of the particular virtual disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 300GiB "
sample : 240057409536
allocated_size :
allocated_size :
description :
description :
- Allocated size in Gibibyte of the particular virtual disk .
- Allocated size in bytes of the particular virtual disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 100GiB "
sample : 240057409536
footprint_on_pool :
footprint_on_pool :
description :
description :
- Footprint on pool in Gibibyte of the particular virtual disk .
- Footprint on pool in bytes of the particular virtual disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 100GiB "
sample : 240057409536
name :
name :
description : Name of the particular virtual disk .
description : Name of the particular virtual disk .
returned : always
returned : always
@ -463,10 +464,10 @@ ansible_facts:
type : string
type : string
sample : " Thin "
sample : " Thin "
allocation_unit_size :
allocation_unit_size :
description : Allocation unit size in Kibibyte of the particular virtual disk .
description : Allocation unit size in bytes of the particular virtual disk .
returned : always
returned : always
type : string
type : int
sample : " 4KiB "
sample : 4096
media_type :
media_type :
description : Media type of the particular virtual disk .
description : Media type of the particular virtual disk .
returned : always
returned : always
@ -490,8 +491,8 @@ ansible_facts:
write_cache_size :
write_cache_size :
description : Write cache size in byte of the particular virtual disk .
description : Write cache size in byte of the particular virtual disk .
returned : always
returned : always
type : string
type : int
sample : " 100s/byte/bytes/ "
sample : 100
fault_domain_awareness :
fault_domain_awareness :
description : Fault domain awareness of the particular virtual disk .
description : Fault domain awareness of the particular virtual disk .
returned : always
returned : always
@ -499,46 +500,45 @@ ansible_facts:
sample : " PhysicalDisk "
sample : " PhysicalDisk "
inter_leave :
inter_leave :
description :
description :
- Inter leave in Kibibyte of the particular virtual disk .
- Inter leave in bytes of the particular virtual disk .
- Accurate to three decimal places .
returned : always
returned : always
type : string
type : int
sample : " 100KiB "
sample : 102400
deduplication_enabled :
deduplication_enabled :
description : Information whether deduplication is enabled for the particular virtual disk .
description : Information whether deduplication is enabled for the particular virtual disk .
returned : always
returned : always
type : string
type : bool
sample : " True "
sample : True
enclosure_aware :
enclosure_aware :
description : Information whether the particular virtual disk is enclosure aware .
description : Information whether the particular virtual disk is enclosure aware .
returned : always
returned : always
type : string
type : bool
sample : " False "
sample : False
manual_attach :
manual_attach :
description : Information whether the particular virtual disk is manual attached .
description : Information whether the particular virtual disk is manual attached .
returned : always
returned : always
type : string
type : bool
sample : " True "
sample : True
snapshot :
snapshot :
description : Information whether the particular virtual disk is a snapshot .
description : Information whether the particular virtual disk is a snapshot .
returned : always
returned : always
type : string
type : bool
sample : " False "
sample : False
tiered :
tiered :
description : Information whether the particular virtual disk is tiered .
description : Information whether the particular virtual disk is tiered .
returned : always
returned : always
type : string
type : bool
sample : " True "
sample : True
physical_sector_size :
physical_sector_size :
description : Physical sector size in Kibibyte of the particular virtual disk .
description : Physical sector size in bytes of the particular virtual disk .
returned : always
returned : always
type : string
type : int
sample : " 4KiB "
sample : 4096
logical_sector_size :
logical_sector_size :
description : Logical sector size in byte of the particular virtual disk .
description : Logical sector size in byte of the particular virtual disk .
returned : always
returned : always
type : string
type : int
sample : " 512s/byte/bytes/ "
sample : 512
available_copies :
available_copies :
description : Number of the available copies of the particular virtual disk .
description : Number of the available copies of the particular virtual disk .
returned : if existent
returned : if existent
@ -567,8 +567,8 @@ ansible_facts:
request_no_spof :
request_no_spof :
description : Information whether the particular virtual disk requests no single point of failure .
description : Information whether the particular virtual disk requests no single point of failure .
returned : always
returned : always
type : string
type : bool
sample : " True "
sample : True
resiliency_setting_name :
resiliency_setting_name :
description : Type of the physical disk redundancy of the particular virtual disk .
description : Type of the physical disk redundancy of the particular virtual disk .
returned : always
returned : always