-
Notifications
You must be signed in to change notification settings - Fork 898
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 more ansible runner specs #23091
Conversation
Co-Authored-By: jaisejose1123 <[email protected]>
Checked commits Fryguy/manageiq@39b67ef~...b6d0c4e with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint lib/ansible/runner/response_async.rb
spec/lib/ansible/runner/data/hello_world_vault_encrypted.yml
|
Probably scope creep, but I wonder if we could use inotify like we do for |
Oh yes, Inotify is a much better option - let me try that |
end | ||
# If the process is still running, then stop it | ||
if result.nil? | ||
stop |
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 could see wanting to wait X seconds for this to complete but not want to stop it, could we pull this out and return nil
if it timed out or something? That way it is up to the caller if they want to kill the run on timeout or not.
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 think I want to leave this as is, because I the interface for wait is to return a response object (i.e. turn a response_async object into a response object.
@Fryguy actually if we just want to wait for the process to finish I think it is even easier than using inotify. All ansible-runner is-alive does is a |
Oh neat - I didn't realize is-alive was so simple. |
|
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'll help with the non-polling version in a follow-up
@agrare Please review.
I'm not sure about the
wait
method, so would like your thoughts there on how better to represent that or perhaps a better method signature.The first commit is partially copied from #23063 cc @jaisejose1123