Orchestration of OpenStack deployment POC #18
Conversation
|
|
||
| def run | ||
| host = ::Host.find(input[:host_id]) | ||
| host.setBuild or fail 'setting build flag failed' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use foreman exceptions here? I think its better as you'll get an error code (and translated string potentially)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
This is pretty amazing. |
| end | ||
|
|
||
| # reset leaves it shutoff on libvirt | ||
| if host.power.state == 'shutoff' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, I would write
case host.power.state
when 'running'
host.power.reset or fail 'resetting host failed'
when 'shutoff'
host.power.start or fail 'starting host failed'
endThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too :) this is to get around bug in libvirt (or somewhere) which is leaving machined 'shutoff' after restart command.
|
I have tested this end to end with provisioning and the ordering of builds works great. |
|
@mtaylor please use PR diff for comments. Comments placed on commits are lost when rebasing or amending. Linking the commit with comments pitr-ch@85b1a5a |
|
Will do, cheers. |
| # planned in concurrence | ||
| # do not touch already installed modules | ||
| # TODO: add better way how to filter hosts (scenarios: redeploy, adding single host when scaling) | ||
| plan_action Host::Deploy, host unless host.installed_at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe consider using the build and or status fields in additional to the installed_at (as thats only for raw/ first time).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am working on it right now. I am extracting it so the array of hosts to use is inject-able by the UI or other parts.
see included doc/orchestration.md
|
Is this ready now? |
|
I'll fix the hook #18 (comment) and then we could merge. |
|
It's ready. |
|
Acks? |
|
acked verbally |
Orchestration of OpenStack deployment POC
opening PR for comments and suggestions
see included doc/orchestration.md