ansible.builtin.filesystem (v2.4.2.0-1) — module

Makes file system on block device

| "added in version" 1.2 of ansible.builtin"

Authors: Alexander Bulimov (@abulimov)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.2.0.post1

Description

This module creates file system.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a ext2 filesystem on /dev/sdb1.
- filesystem:
    fstype: ext2
    dev: /dev/sdb1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a ext4 filesystem on /dev/sdb1 and check disk blocks.
- filesystem:
    fstype: ext4
    dev: /dev/sdb1
    opts: -cc

Inputs

    
dev:
    description:
    - Target block device.
    required: true

opts:
    description:
    - List of options to be passed to mkfs command.

force:
    choices:
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - If yes, allows to create new filesystem on devices that already has filesystem.
    required: false

fstype:
    description:
    - File System type to be created.
    - reiserfs support was added in 2.2.
    required: true

resizefs:
    choices:
    - 'yes'
    - 'no'
    default: 'no'
    description:
    - If yes, if the block device and filessytem size differ, grow the filesystem into
      the space. Note, XFS Will only grow if mounted.
    required: false
    version_added: '2.0'
    version_added_collection: ansible.builtin