win_partition – Creates, changes and removes partitions on Windows Server¶
New in version 2.8.
- 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.
- 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