clustershell
clustershell copied to clipboard
clush: one host, multiple ports
I have a container host where every container listens on it's own port but all on localhost.
It would be nice to not provide the host name to clush but the port, ex: "localhost:[24002-24009]"
This kind of change would require a lot of change inside the code.
However, as a workaround, may be you can create ssh alias in your ssh config. ie:
Host container24002
Hostname localhost
Port 24002
Host container24003
Hostname localhost
Port 24003
...
And then use clustershell as usual
clush -w container[24002-24003] ...
Another way to avoid patching a lot of different places in code would be to write your own Worker which extract the port from the Hostname, like a fork of Ssh Worker...
Using ssh aliases is a good idea - I'll go for those until you have implemented all the changes (just kidding). Thanks! It wouldn't offend me if you close the ticket, although you could keep it as an idea for an enhancement.
An idea for a fix with current Ssh Worker is to introduce placeholders in passed ssh options, so that it could be possible to use the node index as the port (but what index if using nodeset-nD?), and will also require a way to modify the destination host. Other that than, we don't plan to add it as a core feature of Ssh Worker as it mostly rely on ssh system configuration.
This is not interesting for me anymore, so feel free to close this if you want.