Skip to content

Commit

Permalink
Expose individual external URL variables
Browse files Browse the repository at this point in the history
These variables are set based on IRONIC_EXTERNAL_IP by default. In some
cases it makes sense to use different IPs for them.
This commit also adds these variables to the readme along with
IRONIC_EXTERNAL_IP, which was previously undocumented.

Signed-off-by: Lennart Jern <[email protected]>
  • Loading branch information
lentzi90 committed Feb 22, 2024
1 parent 3cbaa6d commit 630006d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ functionality:
- `PROVISIONING_INTERFACE` - interface to use for ironic, dnsmasq(dhcpd) and
httpd (default provisioning, this is calculated if the above
`PROVISIONING_MACS` is provided)
- `PROVISIONING_IP` - the specific IP to use (instead of calculating it based on
the `PROVISIONING_INTERFACE`)
- `DNSMASQ_EXCEPT_INTERFACE` - interfaces to exclude when providing DHCP address
(default `lo`)
- `HTTP_PORT` - port used by http server (default `80`)
Expand Down Expand Up @@ -82,6 +84,14 @@ functionality:
- `IRONIC_CONDUCTOR_HOST` - Host name of the current conductor (only makes
sense to change for a multinode setup). Defaults to the IP address used
for provisioning.
- `IRONIC_EXTERNAL_IP` - Optional external IP if Ironic is not accessible on
`PROVISIONING_IP`.
- `IRONIC_EXTERNAL_CALLBACK_URL` - Override Ironic's external callback URL.
Defaults to use `IRONIC_EXTERNAL_IP` if available.
- `IRONIC_EXTERNAL_HTTP_URL` - Override Ironic's external http URL. Defaults to
use `IRONIC_EXTERNAL_IP` if available.
- `IRONIC_INSPECTOR_CALLBACK_ENDPOINT_OVERRIDE` - Override Inspector's callback
URL. Defaults to use `IRONIC_EXTERNAL_IP` if available.

The ironic configuration can be overridden by various environment variables.
The following can serve as an example:
Expand Down
8 changes: 4 additions & 4 deletions scripts/configure-ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export IRONIC_BASE_URL=${IRONIC_BASE_URL:-"${IRONIC_SCHEME}://${IRONIC_URL_HOST}
export IRONIC_INSPECTOR_BASE_URL=${IRONIC_INSPECTOR_BASE_URL:-"${IRONIC_INSPECTOR_SCHEME}://${IRONIC_URL_HOST}:${IRONIC_INSPECTOR_ACCESS_PORT}"}

if [[ -n "$IRONIC_EXTERNAL_IP" ]]; then
export IRONIC_EXTERNAL_CALLBACK_URL="${IRONIC_SCHEME}://${IRONIC_EXTERNAL_IP}:${IRONIC_ACCESS_PORT}"
export IRONIC_EXTERNAL_CALLBACK_URL=${IRONIC_EXTERNAL_CALLBACK_URL:-"${IRONIC_SCHEME}://${IRONIC_EXTERNAL_IP}:${IRONIC_ACCESS_PORT}"}
if [[ "$IRONIC_VMEDIA_TLS_SETUP" == "true" ]]; then
export IRONIC_EXTERNAL_HTTP_URL="https://${IRONIC_EXTERNAL_IP}:${VMEDIA_TLS_PORT}"
export IRONIC_EXTERNAL_HTTP_URL=${IRONIC_EXTERNAL_HTTP_URL:-"https://${IRONIC_EXTERNAL_IP}:${VMEDIA_TLS_PORT}"}
else
export IRONIC_EXTERNAL_HTTP_URL="http://${IRONIC_EXTERNAL_IP}:${HTTP_PORT}"
export IRONIC_EXTERNAL_HTTP_URL=${IRONIC_EXTERNAL_HTTP_URL:-"http://${IRONIC_EXTERNAL_IP}:${HTTP_PORT}"}
fi
export IRONIC_INSPECTOR_CALLBACK_ENDPOINT_OVERRIDE="https://${IRONIC_EXTERNAL_IP}:${IRONIC_INSPECTOR_ACCESS_PORT}"
export IRONIC_INSPECTOR_CALLBACK_ENDPOINT_OVERRIDE=${IRONIC_INSPECTOR_CALLBACK_ENDPOINT_OVERRIDE:-"https://${IRONIC_EXTERNAL_IP}:${IRONIC_INSPECTOR_ACCESS_PORT}"}
fi

IMAGE_CACHE_PREFIX=/shared/html/images/ironic-python-agent
Expand Down

0 comments on commit 630006d

Please sign in to comment.