23 lines
494 B
YAML
23 lines
494 B
YAML
---
|
|
|
|
- name: Partition disk
|
|
community.general.parted:
|
|
device: "{{ disk.device }}"
|
|
label: gpt
|
|
number: 1
|
|
name: "{{ disk.name }}"
|
|
fs_type: "{{ disk.format }}"
|
|
state: present
|
|
register: register_partition
|
|
|
|
- name: Create filesystem
|
|
community.general.filesystem:
|
|
dev: "{{ disk.device }}1"
|
|
fstype: "{{ disk.format }}"
|
|
|
|
- name: Mount disk
|
|
mount:
|
|
src: "{{ disk.device }}1"
|
|
path: "{{ disk.mount_point }}"
|
|
fstype: "{{ disk.format }}"
|
|
state: mounted
|