Make generic waitcondition for os-refresh-config

Most of the time we will find it useful to pass a wait condition in for
os-refresh-config to signal when it has completed successfully.

This supersedes the notcompute element's completion-handle, so we can
remove that element. It should be removed from tripleo-incubator and
tripleo-ci as well.

Change-Id: Iff65da3dd0a1db496cfd33b4a55abb13c68c9558
This commit is contained in:
Clint Byrum 2013-11-25 19:24:04 -08:00
parent fa289b865c
commit 7abf14ab18
6 changed files with 19 additions and 14 deletions

View File

@ -1,8 +0,0 @@
Handles the notcompute condition in overcloud-source.yaml.
Including notcompute causes the handle completion-handle to be signaled from
postconfigure.d/99-refresh-completed.
The completion-handle comes from Heat Metadata e.g.
Metadata:
completion-handle: {Ref: StackCompleteHandle}

View File

@ -1,2 +0,0 @@
os-apply-config
os-refresh-config

View File

@ -1,4 +0,0 @@
#!/bin/bash
set -eux
curl -X PUT -H 'Content-Type:' --data-binary '{"Status" : "SUCCESS","Reason" : "Configuration Complete","UniqueId" : "","Data" : "Finished os-refresh-config."}' "$(os-apply-config --key completion-handle --type raw)"

View File

@ -30,3 +30,11 @@ of json in this instance's Metadata:
}
}
}
If you would like to signal a wait condition at the end of
post-configure.d, a generic name of 'completion-handle' can be used
like so:
{
"completion-handle": {"Ref": "CompletionHandleName"}
}

View File

@ -1,2 +1,3 @@
source-repositories
os-collect-config
os-apply-config

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -eux
HANDLE=$(os-apply-config --key completion-handle --type raw)
ID=$(os-apply-config --key instance-id --type raw)
[ -n "$HANDLE" ] || exit 0
[ -n "$ID" ] || exit 0
curl -X PUT -H 'Content-Type:' --data-binary "{\"Status\" : \"SUCCESS\",\"Reason\" : \"Configuration Complete\",\"UniqueId\" : \"$ID\",\"Data\" : \"Finished os-refresh-config.\"}" "$(os-apply-config --key completion-handle --type raw)"