uan_disk_config
The uan_disk_config
role configures swap and scratch disk partitions on UAN
nodes.
There must be disk devices found on the UAN node by the device_filter
module
or this role will exit with failure. This condition can be ignored by setting
uan_require_disk
to false
. See variable definitions below.
See the library/device_filter.py
file for more information on this module.
The device that is found will be unmounted if mounted and a swap partition will be created on the first half of the disk, and a scratch partition on the second half. ext4 filesystems are created on each partition.
Available variables are listed below, along with default values (see defaults/main.yml
):
uan_require_disk
Boolean to determine if this role continues to setup disk if no disks were found
by the device filter. Set to true
to exit with error when no disks are found.
Example:
uan_require_disk: false
uan_device_name_filter
Regular expression of disk device name for this role to filter.
Input to the device_filter
module.
Example:
uan_device_name_filter: "^sd[a-f]$"
uan_device_host_filter
Regular expression of host for this role to filter.
Input to the device_filter
module.
Example:
uan_device_host_filter: "
uan_device_model_filter
Regular expression of device model for this role to filter.
Input to the device_filter
module.
Example:
uan_device_model_filter: "
uan_device_vendor_filter
Regular expression of disk vendor for this role to filter.
Input to the device_filter
module.
Example:
uan_device_vendor_filter: "
uan_device_size_filter
Regular expression of disk size for this role to filter.
Input to the device_filter
module.
Example:
uan_device_size_filter: "<1TB"
uan_swap
Filesystem location to mount the swap partition.
Example:
uan_swap: "/swap"
uan_scratch
Filesystem location to mount the scratch partition.
Example:
uan_scratch: "/scratch"
swap_file
Name of the swapfile to create. Full path is <uan_swap>/<swapfile>
.
Example:
swap_file: "swapfile"
swap_dd_command
dd
command to create the swapfile
.
Example:
swap_dd_command: "/usr/bin/dd if=/dev/zero of={{ uan_swap }}/{{ swap_file }} bs=1GB count=10"
swap_swappiness
Value to set the swapiness in sysctl.
Example:
swap_swappiness: "10"
library/device_filter.py
is required to find eligible disk devices.
- hosts: Application_UAN
roles:
- { role: uan_disk_config }
This role is included in the UAN site.yml
play.