Hello,
I am new to Ansible and looking for some assistance. I want to be able to run the Ansible script for changes and or additions without rebuilding the server. In my Ansible script I am using the below snippet to configure the 2 additional drives that I have added to the server. Any suggestions on how to test first that the drives exist with the correct labels, drive letters, and partition styles so Ansible will not run that portion again if it is already configured?
`
- name: Partition and format drive1
win_shell: Get-Disk | Where number -eq '1' | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -UseMaximumSize -DriveLetter E | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Data" -Confirm:$false
- name: Partition and format drive2
win_shell: Get-Disk | Where number -eq '2' | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -UseMaximumSize -DriveLetter F | Format-Volume -FileSystem NTFS -NewFileSystemLabel "DocVault" -Confirm:$false
`
TIA!