Created
November 28, 2019 17:17
-
-
Save jonathanmedd/c1a47ac447bd3125c1fceeacdb83395a to your computer and use it in GitHub Desktop.
_8_initialize-partition-format-disk.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
tasks: | |
- name: Get disk facts | |
win_disk_facts: | |
- name: Initialize Disk | |
win_shell: "Initialize-Disk -Number {{ disk_number }}" | |
when: ansible_disks[disk_number].guid is none | |
- name: Create Partition using all available space | |
win_partition: | |
drive_letter: "{{ drive_letter }}" | |
partition_size: -1 | |
disk_number: "{{ disk_number }}" | |
when: ansible_disks[disk_number].guid is none | |
- name: Format the partition as NTFS and label it | |
win_format: | |
drive_letter: "{{ drive_letter }}" | |
file_system: NTFS | |
new_label: Data | |
when: ansible_disks[disk_number].guid is none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment