-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to check if nodes are reachable via bolt #433
base: main
Are you sure you want to change the base?
Conversation
8e43b1c
to
aededbd
Compare
# | ||
# @author Tim Meusel <[email protected]> | ||
# | ||
function peadm::check_availability( |
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.
this is not peadm specific and I think other plans could benefit from it as well. But I'm not sure which module would be a good place for such a generic function. I think bolt has no generic module where we could add it? Maybe stdlib or extlib are good candidates?
functions/check_availability.pp
Outdated
true => "${messages.join("\n")}\n${end_message}", | ||
false => $end_message, | ||
} | ||
fail_plan($fail_message) |
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.
Something like this I meant above:
fail_plan('Some targets are not reachable', 'peadm/unreachable-nodes', error_set => $check_result.error_set)
@@ -5,6 +5,7 @@ | |||
|
|||
describe 'basic functionality' do | |||
it 'runs successfully with the minimum required parameters' do | |||
allow_out_message |
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 guess this is missing:
expect_plan('peadm::check_availability')
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.
@bastelfreak this too
At the moment the plans assume that all nodes are available. I had a few customer setups where one of the compilers wasn't reachable during a convert/upgrade. To not put the PE infra into an undefined state, it makes sense to check the availability before running the plans.
) >> Integer { | ||
$check_result = wait_until_available($targets, wait_time => 2, _catch_errors => true) | ||
unless $check_result.ok { | ||
$end_message = "${check_result.error_set.count} targets are not reachable, stopping plan" |
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.
Hi @bastelfreak I was chatting to our Docs and he has suggested this change for the messaging;
Bolt cannot reach the following targets: [email protected], [email protected]
<installation conversion upgrade> cannot be continued
Exiting
Is it possible to update it like this?
Hey @bastelfreak just wondering if you got a chance to check out the comments I left? Thanks 😃 |
Hey @bastelfreak this PR is stall, can you please follow up with all comments? |
At the moment the plans assume that all nodes are available. I had a few customer setups where one of the compilers wasn't reachable during a convert/upgrade. To not put the PE infra into an undefined state, it makes sense to check the availability before running the plans.
Summary
Provide a detailed description of all the changes present in this pull request.
Additional Context
Add any additional context about the problem here.
Related Issues (if any)
Mention any related issues or pull requests.
Checklist
Changes include test coverage?
Have you updated the documentation?