ansible / ansible.builtin / v2.5.10 / module / filesystem Makes a filesystem | "added in version" 1.2 of ansible.builtin" Authors: Alexander Bulimov (@abulimov) preview | supported by communityansible.builtin.filesystem (v2.5.10) — module
pip
Install with pip install ansible==2.5.10
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 - lvm - reiserfs - xfs - vfat 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 required: true resizefs: default: 'no' description: - If C(yes), if the block device and filesytem size differ, grow the filesystem into the space. - Supported for C(ext2), C(ext3), C(ext4), C(ext4dev), C(lvm), C(xfs) and C(vfat) 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