community.windows.win_initialize_disk (2.2.0) — module

Initializes disks on Windows Server

Authors: Brant Evans (@branic)

Install collection

Install with ansible-galaxy collection install community.windows:==2.2.0


Add to requirements.yml

  collections:
    - name: community.windows
      version: 2.2.0

Description

The M(community.windows.win_initialize_disk) module initializes disks

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Initialize a disk
  community.windows.win_initialize_disk:
    disk_number: 1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Initialize a disk with an MBR partition style
  community.windows.win_initialize_disk:
    disk_number: 1
    style: mbr
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Forcefully initiallize a disk
  community.windows.win_initialize_disk:
    disk_number: 2
    force: yes

Inputs

    
path:
    description:
    - Used to specify the path to the disk to be initialized.
    type: str

force:
    default: false
    description:
    - Specify if initializing should be forced for disks that are already initialized.
    type: bool

style:
    choices:
    - gpt
    - mbr
    default: gpt
    description:
    - The partition style to use for the disk. Valid options are mbr or gpt.
    type: str

online:
    default: true
    description:
    - If the disk is offline and/or readonly update the disk to be online and not readonly.
    type: bool

uniqueid:
    description:
    - Used to specify the uniqueid of the disk to be initialized.
    type: str

disk_number:
    description:
    - Used to specify the disk number of the disk to be initialized.
    type: int

See also