mirror of
https://github.com/de-it-krachten/ansible-role-windows_storage
synced 2026-05-14 03:51:51 +00:00
No description
- Jinja 91.9%
- PowerShell 8.1%
# [1.5.0](https://github.com/de-it-krachten/ansible-role-windows_storage/compare/v1.4.0...v1.5.0) (2026-03-15) ### Bug Fixes * Add partition check to prevent unnecessary actions ([ |
||
|---|---|---|
| .github/workflows | ||
| defaults | ||
| files | ||
| meta | ||
| molecule/default | ||
| tasks | ||
| .ansible-lint | ||
| .cicd | ||
| .cicd.overwrite | ||
| .collections | ||
| .gitignore | ||
| .releaserc.yml | ||
| .roles | ||
| .yamllint | ||
| CHANGELOG.md | ||
| README.md | ||
ansible-role-windows_storage
Initialize Windows storage (disk format)
Note that GPT disks have a reserved partition '1' after initialization
Dependencies
Roles
None
Collections
- ansible.windows
- community.windows
Platforms
Supported platforms
- Windows Server 2012 R21
- Windows Server 20161
- Windows Server 20191
- Windows Server 20221
- Windows Server 20251
Note: 1 : no automated testing is performed on these platforms
Role Variables
defaults/main.yml
# Show extra information
windows_storage_verbose: false
# Field mapping
windows_storage_fields:
SATA:
adapter: SCSIPort
disk: SCSIBus
SAS:
adapter: SCSIPort
# disk: SCSILogicalUnit # Azure VMs
disk: SCSITargetId # Virtualbox VM's
Example Playbook
molecule/default/converge.yml
- name: sample playbook for role 'windows_storage'
hosts: all
become: 'yes'
vars:
molecule_driver: '{{ lookup(''env'', ''MOLECULE_DRIVER_NAME'') }}'
windows_storage_disk_layout:
- type: SATA
adapter: 0
disk: 1
style: gpt
partitions:
- drive_letter: X
file_system: ntfs
partition_number: 2
partition_size: 100 MiB
allocation_unit_size: 8192
- drive_letter: Y
file_system: ntfs
partition_number: 3
partition_size: 200 MiB
compress: true
- type: SATA
adapter: 0
disk: 2
style: mbr
partitions:
- drive_letter: Z
file_system: ntfs
partition_number: 1
partition_size: -1
label: myfulldisk
roles:
- deitkrachten.facts
tasks:
- name: Include role 'windows_storage'
ansible.builtin.include_role:
name: windows_storage