win_partition – Creates, changes and removes partitions on Windows Server¶
New in version 2.8.
Synopsis¶
- The win_partition module can create, modify or delete a partition on a disk
Parameters¶
Notes¶
Note
- A minimum Operating System Version of 6.2 is required to use this module. To check if your OS is compatible, see https://docs.microsoft.com/en-us/windows/desktop/sysinfo/operating-system-version.
- This module cannot be used for removing the drive letter associated with a partition, initializing a disk or, file system formatting.
- Idempotence works only if you’re specifying a drive letter or other unique attributes such as a combination of disk number and partition number.
- For more information, see https://msdn.microsoft.com/en-us/library/windows/desktop/hh830524.aspx.
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: Resize previously created partition to it's maximum size and change it's drive letter to E
win_partition:
drive_letter: E
partition_size: -1
partition_number: 1
disk_number: 1
- name: Delete partition
win_partition:
disk_number: 1
partition_number: 1
state: absent
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.