ansible.windows.win_initialize_disk module – Initializes disks on Windows Server

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_initialize_disk.

Synopsis

Parameters

Parameter

Comments

disk_number

integer

Used to specify the disk number of the disk to be initialized.

force

boolean

Specify if initializing should be forced for disks that are already initialized.

Choices:

  • false ← (default)

  • true

online

boolean

If the disk is offline and/or readonly update the disk to be online and not readonly.

Choices:

  • false

  • true ← (default)

path

string

Used to specify the path to the disk to be initialized.

style

string

The partition style to use for the disk. Valid options are mbr or gpt.

Choices:

  • "gpt" ← (default)

  • "mbr"

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 Windows Server 2016 or newer is required to use this module.

See Also

See also

ansible.windows.win_initialize_disk_info

Gather information about disks on Windows Server.

Examples

- name: Initialize a disk
  ansible.windows.win_initialize_disk:
    disk_number: 1

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

- name: Forcefully initialize a disk
  ansible.windows.win_initialize_disk:
    disk_number: 2
    force: true

Authors

  • Brant Evans (@branic)

  • Hen Yaish (@yaish25491)