diff --git a/common.sh b/common.sh index d63b80b11..3baf59a4a 100644 --- a/common.sh +++ b/common.sh @@ -494,3 +494,6 @@ if [[ -n "$MIRROR_IMAGES" || -z "${IP_STACK:-}" || "$IP_STACK" = "v6" || "$IP_ST fi export AGENT_TEST_CASES=${AGENT_TEST_CASES:-} + +# Defaults the variable to disable testing software RAID +export TEST_SW_RAID=${TEST_SW_RAID:-true} diff --git a/config_example.sh b/config_example.sh index 50f3133cc..9ca3cc90b 100755 --- a/config_example.sh +++ b/config_example.sh @@ -686,6 +686,10 @@ set -x # will be used as input to the installer. # export AGENT_USE_ZTP_MANIFESTS=false +# TEST_SW_RAID - +# Enable testing of software RAID +# export TEST_SW_RAID=true + # Uncomment and set the following value to "true" to disable the automated # deployment systemd services of the Agent based installation. This is # particularly useful for WebUI development. diff --git a/utils.sh b/utils.sh index b6ba8fe68..57f6e8b85 100755 --- a/utils.sh +++ b/utils.sh @@ -108,6 +108,17 @@ function create_cluster() { mkdir -p ${assets_dir}/openshift generate_assets + if [[ "$TEST_SW_RAID" == "true" ]] && [[ "$NUM_WORKERS" -gt 0 ]]; then + for n in $(seq "$NUM_MASTERS" $(expr "$NUM_WORKERS" + "$NUM_MASTERS" - 1)); + do + sed -i "/status/i \\ + raid: \n\ + softwareRAIDVolumes: \n\ + - level: \"1\" \ +" ${assets_dir}/openshift/99_openshift-cluster-api_hosts-$n.yaml + done + fi + if [ -z "${NTP_SERVERS}" ]; then export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"