community / community.general / 0.1.1 / module / filesystem Makes a filesystem Authors: Alexander Bulimov (@abulimov) preview | supported by communitycommunity.general.filesystem (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
This module creates a filesystem.
- name: Create a ext2 filesystem on /dev/sdb1 filesystem: fstype: ext2 dev: /dev/sdb1
- name: Create a ext4 filesystem on /dev/sdb1 and check disk blocks filesystem: fstype: ext4 dev: /dev/sdb1 opts: -cc
dev: aliases: - device description: - Target path to device or image file. required: true opts: description: - List of options to be passed to mkfs command. force: default: 'no' description: - If C(yes), allows to create new filesystem on devices that already has filesystem. type: bool fstype: aliases: - type choices: - btrfs - ext2 - ext3 - ext4 - ext4dev - f2fs - lvm - ocfs2 - reiserfs - xfs - vfat - swap description: - Filesystem type to be created. - reiserfs support was added in 2.2. - lvm support was added in 2.5. - since 2.5, I(dev) can be an image file. - vfat support was added in 2.5 - ocfs2 support was added in 2.6 - f2fs support was added in 2.7 - swap support was added in 2.8 required: true resizefs: default: 'no' description: - If C(yes), if the block device and filesystem size differ, grow the filesystem into the space. - Supported for C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs), C(vfat), C(swap) filesystems. - XFS Will only grow if mounted. - vFAT will likely fail if fatresize < 1.04. type: bool