|
2 | 2 |
|
3 | 3 | set -euo pipefail |
4 | 4 |
|
5 | | -# shellcheck disable=SC1091 |
6 | | -. /usr/local/bin/release-image.sh |
7 | | - |
8 | 5 | export KUBECONFIG=/opt/openshift/auth/kubeconfig-loopback |
9 | 6 |
|
10 | 7 | # Wait till the baremetalhosts are populated |
|
16 | 13 | AUTH_DIR=/opt/metal3/auth |
17 | 14 | set +x |
18 | 15 | ironic_url="$(printf 'http://%s:%s@localhost:6385/v1' "$(cat "${AUTH_DIR}/ironic/username")" "$(cat "${AUTH_DIR}/ironic/password")")" |
19 | | -inspector_url="$(printf 'http://%s:%s@localhost:5050/v1' "$(cat "${AUTH_DIR}/ironic-inspector/username")" "$(cat "${AUTH_DIR}/ironic-inspector/password")")" |
20 | 16 |
|
21 | 17 | # Wait for a master to appear. |
22 | 18 | while [ "$(curl -s "${ironic_url}/nodes" | jq '.nodes[] | .uuid' | wc -l)" -lt 1 ]; do |
|
33 | 29 |
|
34 | 30 | echo Nodes are all active |
35 | 31 |
|
36 | | -BAREMETAL_OPERATOR_IMAGE=$(image_for baremetal-operator) |
37 | | - |
38 | | -for node in $(curl -s "${ironic_url}/nodes" | jq -r '.nodes[] | .uuid'); do |
39 | | - name=$(curl -H "X-OpenStack-Ironic-API-Version: 1.9" -s "${ironic_url}/nodes/${node}" | jq -r .name | cut -d "~" -f 2) |
40 | | - echo "Host $name, UUID: $node" |
41 | | - # And use the baremetal operator tool to load the introspection data into |
42 | | - # the BareMetalHost CRs as annotations, which BMO then picks up. |
43 | | - HARDWARE_DETAILS=$(podman run --quiet --net=host \ |
44 | | - --rm \ |
45 | | - --entrypoint /get-hardware-details \ |
46 | | - "${BAREMETAL_OPERATOR_IMAGE}" \ |
47 | | - "${inspector_url}" "$node" | jq '{hardware: .}') |
48 | | - |
49 | | - oc annotate --overwrite -n openshift-machine-api baremetalhosts "$name" 'baremetalhost.metal3.io/status'="$HARDWARE_DETAILS" 'baremetalhost.metal3.io/paused-' |
50 | | -done |
51 | | - |
52 | 32 | # Shut down ironic containers so that the API VIP can fail over to the control |
53 | 33 | # plane. |
54 | 34 | echo "Stopping provisioning services..." |
|
0 commit comments