ansible / ansible.builtin / v2.9.27 / module / filesystem Makes a filesystem | "added in version" 1.2 of ansible.builtin" Authors: Alexander Bulimov (@abulimov) preview | supported by communityansible.builtin.filesystem (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
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 version_added: '2.0' version_added_collection: ansible.builtin