Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
Wait for baremetal image/kernel/ramdisk to download
Browse files Browse the repository at this point in the history
Until these are available via the *-downloader containers
we should not start deploying the masters, as sadness and failure
will result.
  • Loading branch information
Steven Hardy committed Jun 25, 2019
1 parent 3c78535 commit 3acca4e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions data/data/baremetal/masters/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ resource "null_resource" "api-wait" {
}
}

# We also wait for the RHCOS image and IPA kernel and ramdisk or the master provisioning will fail
resource "null_resource" "image-wait" {
provisioner "local-exec" {
command = "timeout 900 bash -c 'while ! curl -I http://172.22.0.2/images/rhcos-ootpa-latest.qcow2.md5sum | grep -q ETag; do sleep 5; done'"
}
}

resource "null_resource" "kernel-wait" {
provisioner "local-exec" {
command = "timeout 900 bash -c 'while ! curl -I http://172.22.0.2/images/ironic-python-agent.kernel | grep -q ETag; do sleep 5; done'"
}
}

resource "null_resource" "ramdisk-wait" {
provisioner "local-exec" {
command = "timeout 900 bash -c 'while ! curl -I http://172.22.0.2/images/ironic-python-agent.initramfs | grep -q ETag; do sleep 5; done'"
}
}


resource "ironic_node_v1" "openshift-master-host" {
count = var.master_count
name = var.hosts[count.index]["name"]
Expand All @@ -29,6 +49,9 @@ resource "ironic_node_v1" "openshift-master-host" {
driver_info = var.driver_infos[count.index]
depends_on = [
null_resource.api-wait,
null_resource.image-wait,
null_resource.ramdisk-wait,
null_resource.kernel-wait,
]
}

Expand Down

0 comments on commit 3acca4e

Please sign in to comment.