win_initialize_disk – Initializes disks on Windows Server

Synopsis

Parameters

Parameter Choices/Defaults Comments
disk_number
integer
Used to specify the disk number of the disk to be initialized.
force
boolean
    Choices:
  • no
  • yes
Specify if initializing should be forced for disks that are already initialized.
online
boolean
    Choices:
  • no
  • yes ←
If the disk is offline and/or readonly update the disk to be online and not readonly.
path
string
Used to specify the path to the disk to be initialized.
style
string
    Choices:
  • gpt ←
  • mbr
The partition style to use for the disk. Valid options are mbr or gpt.
uniqueid
string
Used to specify the uniqueid of the disk to be initialized.

Notes

Note

  • One of three parameters (disk_number, uniqueid, and path) are mandatory to identify the target disk, but more than one cannot be specified at the same time.
  • A minimum Operating System Version of Server 2012 or Windows 8 is required to use this module.
  • This module is idempotent if force is not specified.

See Also

See also

win_disk_facts – Show the attached disks and disk information of the target host
The official documentation on the win_disk_facts module.
win_partition – Creates, changes and removes partitions on Windows Server
The official documentation on the win_partition module.
win_format – Formats an existing volume or a new volume on an existing partition on Windows
The official documentation on the win_format module.

Examples

- name: Initialize a disk
  win_initialize_disk:
    disk_number: 1

- name: Initialize a disk with an MBR partition style
  win_initialize_disk:
    disk_number: 1
    style: mbr

- name: Forcefully initiallize a disk
  win_initialize_disk:
    disk_number: 2
    force: yes

Status

Authors

  • Brant Evans (@branic)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.