diff --git a/install.sh b/install.sh index 43e0b86..dc62208 100755 --- a/install.sh +++ b/install.sh @@ -73,6 +73,19 @@ kolla-genpwd # 4. Patch globals.yml GLOBALS_FILENAME="/etc/kolla/globals.yml" +enable_kolla_options() { + local globals_file="$1" + shift # Remove the first argument, leaving only the option names + local options=("$@") + + for option in "${options[@]}"; do + echo "Enabling ${option}..." + # This regex looks for lines starting with #option: and replaces + # the entire line with the enabled version. + sed -i "s@^#${option}:.*@${option}: \"yes\"@g" "${globals_file}" + done +} + #openstack_release: "master" sed -i "s@^#openstack_release:.*@openstack_release: \"2025.2\"@g" "${GLOBALS_FILENAME}" @@ -82,18 +95,23 @@ sed -i "s@^#network_interface:.*@network_interface: \"${FIRST_INTERFACE}\"@g" "$ sed -i "s@^#neutron_external_interface:.*@neutron_external_interface: \"${EXTERNAL_INTERFACE}\"@g" "${GLOBALS_FILENAME}" sed -i "s@^#kolla_internal_vip_address:.*@kolla_internal_vip_address: \"${INTERNAL_IP}\"@g" "${GLOBALS_FILENAME}" -# Enable Keystone/Horizon by default (often needed for a working UI) -sed -i "s@^#enable_horizon:.*@enable_horizon: \"yes\"@g" "${GLOBALS_FILENAME}" +# Define the services you want to toggle +SERVICES_TO_ENABLE=( + "enable_horizon" + "enable_neutron_fwaas" + "enable_neutron_qos" + "enable_cinder" + "enable_mariadb" + "enable_valkey" +) + +# Call the function +enable_kolla_options "${GLOBALS_FILENAME}" "${SERVICES_TO_ENABLE[@]}" -sed -i "s@^#enable_cinder:.*@enable_cinder: yes@g" "${GLOBALS_FILENAME}" #sed -i "s@^#enable_cinder_backend_nfs:.*@enable_cinder_backend_nfs: true@g" "${GLOBALS_FILENAME}" -sed -i "s@^#enable_cinder_backend_lvm:.*@enable_cinder_backend_lvm: true@g" "${GLOBALS_FILENAME}" -sed -i "s@^#cinder_volume_group:.*@cinder_volume_group: \"cinder-volumes\"@g" "${GLOBALS_FILENAME}" - -sed -i "s@^#enable_valkey:.*@enable_valkey: true@g" "${GLOBALS_FILENAME}" - -# to allow load balancer -sed -i "s@^#enable_octavia:.*@enable_octavia: true@g" "${GLOBALS_FILENAME}" +#sed -i "s@^#enable_cinder_backend_lvm:.*@enable_cinder_backend_lvm: true@g" "${GLOBALS_FILENAME}" +#sed -i "s@^#cinder_volume_group:.*@cinder_volume_group: \"cinder-volumes\"@g" "${GLOBALS_FILENAME}" +#sed -i "s@^#enable_octavia:.*@enable_octavia: true@g" "${GLOBALS_FILENAME}" cat <> "${GLOBALS_FILENAME}" octavia_certs_country: IL