diff --git a/lib/ironic b/lib/ironic index bc2d219e3c..98619c5f51 100644 --- a/lib/ironic +++ b/lib/ironic @@ -104,7 +104,8 @@ IRONIC_BIN_DIR=$(get_python_exec_prefix) # Ironic connection info. Note the port must be specified. IRONIC_SERVICE_PROTOCOL=http -IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:6385} +IRONIC_SERVICE_PORT=${IRONIC_SERVICE_PORT:-6385} +IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:$IRONIC_SERVICE_PORT} # Tell Tempest this project is present TEMPEST_SERVICES+=,ironic @@ -277,6 +278,7 @@ function configure_ironic_api { iniset $IRONIC_CONF_FILE DEFAULT policy_file $IRONIC_POLICY_JSON configure_auth_token_middleware $IRONIC_CONF_FILE ironic $IRONIC_AUTH_CACHE_DIR/api iniset_rpc_backend ironic $IRONIC_CONF_FILE DEFAULT + iniset $IRONIC_CONF_FILE api port $IRONIC_SERVICE_PORT cp -p $IRONIC_DIR/etc/ironic/policy.json $IRONIC_POLICY_JSON } @@ -298,7 +300,7 @@ function configure_ironic_conductor { iniset $IRONIC_CONF_FILE DEFAULT rootwrap_config $IRONIC_ROOTWRAP_CONF iniset $IRONIC_CONF_FILE DEFAULT enabled_drivers $IRONIC_ENABLED_DRIVERS - iniset $IRONIC_CONF_FILE conductor api_url http://$HOST_IP:6385 + iniset $IRONIC_CONF_FILE conductor api_url $IRONIC_SERVICE_PROTOCOL://$HOST_IP:$IRONIC_SERVICE_PORT iniset $IRONIC_CONF_FILE pxe tftp_server $IRONIC_TFTPSERVER_IP iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images @@ -419,7 +421,7 @@ function start_ironic { function start_ironic_api { run_process ir-api "$IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE" echo "Waiting for ir-api ($IRONIC_HOSTPORT) to start..." - if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$IRONIC_HOSTPORT; do sleep 1; done"; then + if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT; do sleep 1; done"; then die $LINENO "ir-api did not start" fi } @@ -586,7 +588,7 @@ function configure_iptables { sudo modprobe nf_nat_tftp # nodes boot from TFTP and callback to the API server listening on $HOST_IP sudo iptables -I INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true - sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $IRONIC_HOSTPORT -j ACCEPT || true + sudo iptables -I INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then # agent ramdisk gets instance image from swift sudo iptables -I INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true @@ -748,7 +750,7 @@ function cleanup_baremetal_basic_ops { sudo rm -rf /etc/xinetd.d/tftp /etc/init/tftpd-hpa.override restart_service xinetd sudo iptables -D INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true - sudo iptables -D INPUT -d $HOST_IP -p tcp --dport 6385 -j ACCEPT || true + sudo iptables -D INPUT -d $HOST_IP -p tcp --dport $IRONIC_SERVICE_PORT -j ACCEPT || true if [ "$IRONIC_DEPLOY_DRIVER" == "agent_ssh" ]; then # agent ramdisk gets instance image from swift sudo iptables -D INPUT -d $HOST_IP -p tcp --dport ${SWIFT_DEFAULT_BIND_PORT:-8080} -j ACCEPT || true diff --git a/lib/nova_plugins/hypervisor-ironic b/lib/nova_plugins/hypervisor-ironic index 4004cc935a..420950328e 100644 --- a/lib/nova_plugins/hypervisor-ironic +++ b/lib/nova_plugins/hypervisor-ironic @@ -47,7 +47,7 @@ function configure_nova_hypervisor { iniset $NOVA_CONF ironic admin_password $ADMIN_PASSWORD iniset $NOVA_CONF ironic admin_url $KEYSTONE_AUTH_URI/v2.0 iniset $NOVA_CONF ironic admin_tenant_name demo - iniset $NOVA_CONF ironic api_endpoint http://$SERVICE_HOST:6385/v1 + iniset $NOVA_CONF ironic api_endpoint $IRONIC_SERVICE_PROTOCOL://$IRONIC_HOSTPORT/v1 } # install_nova_hypervisor() - Install external components