diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 400c337aa4..ea3093c3d5 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -33,9 +33,11 @@ info_block "Checking for required libraries." 2> /dev/null || source $(dirname $ # Log some data about the instance and the rest of the system log_instance_info -# Determine the largest secondary disk device available for repartitioning -DATA_DISK_DEVICE=$(lsblk -brndo NAME,TYPE,RO,SIZE | \ - awk '/d[b-z]+ disk 0/{ if ($4>m){m=$4; d=$1}}; END{print d}') +# Get minimum disk size +DATA_DISK_MIN_SIZE="$((1024**3 * $(awk '/bootstrap_host_data_disk_min_size/{print $2}' $(dirname ${0})/../tests/roles/bootstrap-host/defaults/main.yml) ))" + +# Determine the largest secondary disk device that meets the minimum size +DATA_DISK_DEVICE=$(lsblk -brndo NAME,TYPE,RO,SIZE | awk '/d[b-z]+ disk 0/{ if ($4>m && $4>='$DATA_DISK_MIN_SIZE'){m=$4; d=$1}}; END{print d}') # Only set the secondary disk device option if there is one if [ -n "${DATA_DISK_DEVICE}" ]; then diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index ec6691d828..abdefe987b 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -80,7 +80,7 @@ bootstrap_host_data_disk_device_force: no # # If the storage capacity on this device is greater than or equal to this # size (in GB), the bootstrap process will use it. -bootstrap_host_data_disk_min_size: 80 +bootstrap_host_data_disk_min_size: 60 ### MongoDB Settings # MongoDB is installed on the host in the AIO for Ceilometer and Aodh to use. diff --git a/tests/roles/bootstrap-host/tasks/check-requirements.yml b/tests/roles/bootstrap-host/tasks/check-requirements.yml index 55f705f37f..14faa74d12 100644 --- a/tests/roles/bootstrap-host/tasks/check-requirements.yml +++ b/tests/roles/bootstrap-host/tasks/check-requirements.yml @@ -66,7 +66,7 @@ - name: Fail if there is not enough space available in / assert: that: | - (host_root_space_available_bytes | int) >= ((host_data_disk_min_size_bytes | int) * 0.75) + (host_root_space_available_bytes | int) >= (host_data_disk_min_size_bytes | int) when: - bootstrap_host_data_disk_device is not defined tags: