win_format – Formats an existing volume or a new volume on an existing partition on Windows¶
New in version 2.8.
Synopsis¶
- The win_format module formats an existing volume or a new volume on an existing partition on Windows
Parameters¶
Notes¶
Note
- One of three parameters (drive_letter, path and label) are mandatory to identify the target volume but more than one cannot be specified at the same time.
- This module is idempotent if force is not specified and file system labels remain preserved.
- For more information, see https://docs.microsoft.com/en-us/previous-versions/windows/desktop/stormgmt/format-msft-volume
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.
Examples¶
- name: Create a partition with drive letter D and size 5 GiB
win_partition:
drive_letter: D
partition_size: 5 GiB
disk_number: 1
- name: Full format the newly created partition as NTFS and label it
win_format:
drive_letter: D
file_system: NTFS
new_label: Formatted
full: True
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Varun Chopra (@chopraaa) <v@chopraaa.com>
Hint
If you notice any issues in this documentation, you can edit this document to improve it.