AerisCloud.disk
Disk
This role lets you format extra disks and attach them to different locations in your system.
You can use it to move data from various services to a separate disk.
Configuration
Inventory
To set up additional disks, you must write the configuration in YAML format within a group_vars
directory.
# inventory/group_vars/GROUP_NAME
disk_additional_disks:
- disk: /dev/sdb
fstype: ext4
mount_options: defaults
mount: /data
user: www-data
group: www-data
mode: "0755"
disable_periodic_fsck: false
- disk: /dev/nvme0n1
part: /dev/nvme0n1p1
fstype: xfs
mount_options: defaults,noatime
mount: /data2
- device_name: /dev/sdf
fstype: ext4
mount_options: defaults
mount: /data
Here’s what each term means:
disk
: The name of the device you want to mount.part
: The name of the first partition. If you don’t specify this and partitioning is enabled, it will automatically use1
.fstype
: The type of file system for the new disk.mount_options
: Custom options for mounting the disk.mount
: The directory where the disk will be mounted.user
: Sets the owner of the mount directory (default isroot
).group
: Sets the group for the mount directory (default isroot
).mode
: Sets permissions for the mount directory (default is0755
).disable_periodic_fsck
: Turns off automatic filesystem checks for the new disk.
You can also add:
disk_package_use
: The package manager to be used (like yum, apt, etc.). The default is 'auto', which will try to detect it automatically.disk_enable_partitioning: false
: This disables partitioning.
Supported Filesystems:
*) Note: To use these filesystems, you need to install additional software packages. Make sure to check the correct package names for your operating system.
# inventory/group_vars/GROUP_NAME
additional_fs_utils:
- xfsprogs # package for mkfs.xfs on RedHat / Ubuntu
- btrfs-progs # package for mkfs.btrfs on CentOS / Debian
How It Works
The system uses sfdisk
to create a single primary partition that takes up the entire disk. Then, it creates the specified filesystem using mkfs
. Finally, it mounts the new filesystem to the given location.
Informazioni sul progetto
This role allows setting up extra disks and their mount points
Installa
ansible-galaxy install AerisCloud.disk
Licenza
mit
Download
218.7k
Proprietario
Integrated local development and production management