Chapter 38. Persistently mounting a file system using RHEL System Roles
This section describes how to persistently mount a file system using the
An Ansible playbook that uses the
For information on how to apply such a playbook, see Applying a role.
38.1. Example Ansible playbook to persistently mount a file system
This section provides an example Ansible playbook. This playbook applies the
storage role to immediately and persistently mount an XFS file system.
Example 38.1. A playbook that mounts a file system on /dev/sdb to /mnt/data
--- - hosts: all vars: storage_volumes: - name: barefs type: disk disks: - sdb fs_type: xfs mount_point: /mnt/data roles: - rhel-system-roles.storage
This playbook adds the file system to the
/etc/fstabfile, and mounts the file system immediately.
If the file system on the
/dev/sdbdevice or the mount point directory do not exist, the playbook creates them.
For details about the parameters used in the
storagesystem role, see the