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
The ansible.windows.win_initialize_disk module initializes disks
Parameters
Parameter |
Comments |
|---|---|
Used to specify the disk number of the disk to be initialized. |
|
Specify if initializing should be forced for disks that are already initialized. Choices:
|
|
If the disk is offline and/or readonly update the disk to be online and not readonly. Choices:
|
|
Used to specify the path to the disk to be initialized. |
|
The partition style to use for the disk. Valid options are mbr or gpt. Choices:
|
|
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