Skip to content

Commit

Permalink
fix 07_deploy_hub.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 15, 2024
1 parent 256f1f7 commit 1942ed8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/07_deploy_hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ echo {{ api_ip }} api.$HUB.$DOMAIN >> /etc/hosts
{% endif %}

{% if virtual_hub %}
kcli delete iso --yes $CLUSTER.iso || true
kcli delete iso --yes $HUB.iso || true
{% endif %}

mkdir -p ocp/openshift
Expand All @@ -68,9 +68,9 @@ fi

openshift-install agent create image --dir ocp --log-level debug

mv -f ocp/agent.x86_64.iso /var/www/html/$CLUSTER.iso
mv -f ocp/agent.x86_64.iso /var/www/html/$HUB.iso
restorecon -Frv /var/www/html
chown apache.apache /var/www/html/$CLUSTER.iso
chown apache.apache /var/www/html/$HUB.iso

AI_TOKEN=$(jq '.["*image.Ignition"].Config.storage.files[] | select(.path == "/usr/local/share/assisted-service/assisted-service.env") | .contents.source' ocp/.openshift_install_state.json | cut -d, -f2 | sed 's/"//' | base64 -d | grep AGENT_AUTH_TOKEN | cut -d= -f2)
[ "$AI_TOKEN" == "" ] || echo export AI_TOKEN=$AI_TOKEN >> /root/.bashrc
Expand All @@ -84,13 +84,13 @@ echo $IP | grep -q ':' && IP=[$IP]
{% set url = host["redfish_address"]|default("http://127.0.0.1:9000/redfish/v1/Systems/kcli/%s-%s-%s" % (cluster, role, num)) %}
{% set user = host['bmc_user']|default(bmc_user) %}
{% set password = host['bmc_password']|default(bmc_password) %}
kcli start baremetal-host -P url={{ url }} -P user={{ user }} -P password={{ password }} -P iso_url=http://$IP/$CLUSTER.iso
kcli start baremetal-host -P url={{ url }} -P user={{ user }} -P password={{ password }} -P iso_url=http://$IP/$HUBn.iso
{% endfor %}

{% if hosts|length == 1 %}
SNO_IP={{ rendezvous_ip or static_ips[0] }}
sed -i "/api.$CLUSTER.$DOMAIN/d" /etc/hosts
echo $SNO_IP api.$CLUSTER.$DOMAIN >> /etc/hosts
sed -i "/api.$HUB.$DOMAIN/d" /etc/hosts
echo $SNO_IP api.$HUB.$DOMAIN >> /etc/hosts
{% endif %}

openshift-install --dir ocp --log-level debug wait-for install-complete || openshift-install --dir ocp --log-level debug wait-for install-complete
Expand Down

0 comments on commit 1942ed8

Please sign in to comment.