Skip to content

Commit

Permalink
Merge pull request metal3-io#83 from hardys/openshift_fast_track
Browse files Browse the repository at this point in the history
Update inspection configuration to enable fast-track
  • Loading branch information
openshift-merge-robot committed Jul 9, 2020
2 parents 529e212 + a24cf85 commit d547a5a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
13 changes: 13 additions & 0 deletions configure-ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ IRONIC_FAST_TRACK=${IRONIC_FAST_TRACK:-true}

wait_for_interface_or_ip

if [[ $IRONIC_FAST_TRACK == true ]]; then
INSPECTOR_POWER_OFF=false
# TODO(dtantsur): ipa-api-url should be populated by ironic itself, but
# it's not yet, so working around here.
INSPECTOR_EXTRA_ARGS=" ipa-api-url=http://${IRONIC_URL_HOST}:6385"
else
INSPECTOR_POWER_OFF=true
INSPECTOR_EXTRA_ARGS=""
fi

cp /etc/ironic/ironic.conf /etc/ironic/ironic.conf_orig

crudini --merge /etc/ironic/ironic.conf <<EOF
Expand All @@ -34,6 +44,9 @@ fast_track = ${IRONIC_FAST_TRACK}
[inspector]
endpoint_override = http://${IRONIC_URL_HOST}:5050
power_off = ${INSPECTOR_POWER_OFF}
# NOTE(dtantsur): keep inspection arguments synchronized with inspector.ipxe
extra_kernel_params = ipa-inspector-collectors=default,extra-hardware,logs ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1 ${INSPECTOR_EXTRA_ARGS}
[mdns]
interfaces = $IRONIC_IP
Expand Down
4 changes: 3 additions & 1 deletion inspector.ipxe
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
:retry_boot
echo In inspector.ipxe
imgfree
kernel --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.kernel ipa-inspection-callback-url=http://IRONIC_IP:5050/v1/continue ipa-inspection-collectors=default,extra-hardware,logs systemd.journald.forward_to_console=yes BOOTIF=${mac} ipa-debug=1 ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1 initrd=ironic-python-agent.initramfs || goto retry_boot
# NOTE(dtantsur): keep inspection kernel params in [mdns]params in
# ironic-inspector-image and configuration in configure-ironic.sh
kernel --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.kernel ipa-inspection-callback-url=http://IRONIC_IP:5050/v1/continue ipa-inspection-collectors=default,extra-hardware,logs systemd.journald.forward_to_console=yes BOOTIF=${mac} ipa-debug=1 ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1 EXTRA_ARGS initrd=ironic-python-agent.initramfs || goto retry_boot
initrd --timeout 60000 http://IRONIC_IP:HTTP_PORT/images/ironic-python-agent.initramfs || goto retry_boot
boot
14 changes: 13 additions & 1 deletion runhttpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@

HTTP_PORT=${HTTP_PORT:-"80"}

# Whether to enable fast_track provisioning or not
IRONIC_FAST_TRACK=${IRONIC_FAST_TRACK:-true}

wait_for_interface_or_ip

mkdir -p /shared/html
chmod 0777 /shared/html

if [[ $IRONIC_FAST_TRACK == true ]]; then
INSPECTOR_EXTRA_ARGS="ipa-api-url=http://${IRONIC_URL_HOST}:6385"
else
INSPECTOR_EXTRA_ARGS=""
fi

# Copy files to shared mount
cp /tmp/inspector.ipxe /shared/html/inspector.ipxe
cp /tmp/dualboot.ipxe /shared/html/dualboot.ipxe

# Use configured values
sed -i -e s/IRONIC_IP/${IRONIC_URL_HOST}/g -e s/HTTP_PORT/${HTTP_PORT}/g /shared/html/inspector.ipxe
sed -i -e s/IRONIC_IP/${IRONIC_URL_HOST}/g \
-e s/HTTP_PORT/${HTTP_PORT}/g \
-e "s|EXTRA_ARGS|${INSPECTOR_EXTRA_ARGS}|g" \
/shared/html/inspector.ipxe

sed -i 's/^Listen .*$/Listen [::]:'"$HTTP_PORT"'/' /etc/httpd/conf/httpd.conf
sed -i -e 's|\(^[[:space:]]*\)\(DocumentRoot\)\(.*\)|\1\2 "/shared/html"|' \
Expand Down

0 comments on commit d547a5a

Please sign in to comment.