diff --git a/scripts/auth-common.sh b/scripts/auth-common.sh index 90cea4c5b..9e3b8d071 100644 --- a/scripts/auth-common.sh +++ b/scripts/auth-common.sh @@ -15,38 +15,60 @@ IRONIC_HTPASSWD_FILE=/etc/ironic/htpasswd if [[ -f "/auth/ironic/htpasswd" ]]; then IRONIC_HTPASSWD=$( "${IRONIC_HTPASSWD_FILE}-rpc" + else + printf "%s\n" "${IRONIC_RPC_HTPASSWD}" > "${IRONIC_HTPASSWD_FILE}-rpc" fi } configure_ironic_auth() { - local config=/etc/ironic/ironic.conf # Configure HTTP basic auth for API server if [[ -n "${IRONIC_HTPASSWD}" ]]; then printf "%s\n" "${IRONIC_HTPASSWD}" > "${IRONIC_HTPASSWD_FILE}" if [[ "${IRONIC_REVERSE_PROXY_SETUP}" == "false" ]]; then - crudini --set "${config}" DEFAULT auth_strategy http_basic - crudini --set "${config}" DEFAULT http_basic_auth_user_file "${IRONIC_HTPASSWD_FILE}" + crudini --set "${IRONIC_CONFIG}" DEFAULT auth_strategy http_basic + crudini --set "${IRONIC_CONFIG}" DEFAULT http_basic_auth_user_file "${IRONIC_HTPASSWD_FILE}" fi fi } diff --git a/scripts/configure-ironic.sh b/scripts/configure-ironic.sh index 3c6dc5afc..3c6333e9c 100755 --- a/scripts/configure-ironic.sh +++ b/scripts/configure-ironic.sh @@ -84,12 +84,10 @@ env | grep "^OS_" || true mkdir -p /shared/html mkdir -p /shared/ironic_prometheus_exporter -configure_json_rpc_auth - # The original ironic.conf is empty, and can be found in ironic.conf_orig render_j2_config /etc/ironic/ironic.conf.j2 /etc/ironic/ironic.conf -configure_client_basic_auth ironic-rpc +configure_json_rpc_auth # Make sure ironic traffic bypasses any proxies export NO_PROXY="${NO_PROXY:-},$IRONIC_IP"