community.general.filesystem – Makes a filesystem¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.filesystem
.
Requirements¶
The below requirements are needed on the host that executes this module.
Uses tools related to the fstype (
mkfs
) andblkid
command. When resizefs is enabled,blockdev
command is required too.
Parameters¶
Notes¶
Note
Potential filesystem on dev are checked using
blkid
, in caseblkid
isn’t able to detect an existing filesystem, this filesystem is overwritten even if force isno
.This module supports check_mode.
Examples¶
- name: Create a ext2 filesystem on /dev/sdb1
community.general.filesystem:
fstype: ext2
dev: /dev/sdb1
- name: Create a ext4 filesystem on /dev/sdb1 and check disk blocks
community.general.filesystem:
fstype: ext4
dev: /dev/sdb1
opts: -cc
- name: Blank filesystem signature on /dev/sdb1
community.general.filesystem:
dev: /dev/sdb1
state: absent
Authors¶
Alexander Bulimov (@abulimov)