Red Hat Training

A Red Hat training course is available for RHEL 8

Chapter 45. Creating and mounting ext3 file systems using RHEL System Roles

This section describes how to create an ext3 file system with a given label on a disk, and persistently mount the file system using the storage role.


  • An Ansible playbook including the storage role exists.

For information on how to apply such a playbook, see Applying a role.

45.1. Example Ansible playbook to create and mount an ext3 file system

This section provides an example Ansible playbook. This playbook applies the storage role to create and mount an Ext3 file system.

Example 45.1. A playbook that creates Ext3 on /dev/sdb and mounts it at /mnt/data

- hosts: all
      - name: barefs
        type: disk
          - sdb
        fs_type: ext3
        fs_label: label-name
        mount_point: /mnt/data
  • The playbook creates the file system on the /dev/sdb disk.
  • The playbook persistently mounts the file system at the /mnt/data directory.
  • The label of the file system is label-name.

Additional resources

  • The /usr/share/ansible/roles/ file.

45.2. Additional resources