-
Notifications
You must be signed in to change notification settings - Fork 14
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 a hostname in SSHKit.run's return tuple. #132
Comments
Hi @seungjin, if you have an context = SSHKit.context(["h1.eg.io", …])
results = SSHKit.run(context, "…")
Enum.zip(context.hosts, results) However, we've had a similar request before and I can see why this might be useful 🤔 If we decide to add this, I would probably add the ["h1.eg.io", "h2.eg.io"]
|> SSHKit.context()
|> SSHKit.run("echo \"Hello World!\"")
# => [
# {:ok, %SSHKit.host{name: "h1.eg.io", options: []}, [stdout: "Hello World!\n"], 0},
# {:ok, %SSHKit.host{name: "h2.eg.io", options: []}, […], 0},
# ] What do you think? 🙂 Also I'd like to hear a few more voices @tessi, @brienw, @holetse 👋🙂 PS: This'd be a "breaking change" requiring a major version bump. |
+1 from me on adding this support. |
We achieved similar parallel-run output w/ host names by passing a channel function to |
It would be nice to add a hostname in SSHKit's return tuple.
Currently SSHKit.run returns {:ok, output, exit_code}. https://hexdocs.pm/sshkit/SSHKit.SSH.html#run/3
This is not going to be easy to see its output without hostname when we run SSHKit.run with :parallel.
Something like {:ok, hostname, output, exit_code} will be very helpful.
The text was updated successfully, but these errors were encountered: