tmux-cluster
tmux-cluster copied to clipboard
Support for cssh tags files
Clusterssh cluster files are easy to use, but they get cluttered if you have many machines, since you have to list them all in the same line. Clusterssh tag files fix this problem by essentially reversing the config syntax: each line starts with a host name, and then follows a list of tags the given host belongs to. Could you add support for tag files?
Thank you for submitting this issue. I like this idea and will be looking into it at some point.
Do you happen to know if cssh already has this feature, and if so, where it's documented? I took a quick look at the cssh man page, but I didn't see anything about tag files.
I'm not sure what version of cssh that page belongs to. I checked on my local machine and a newly set up ubuntu container and both contain this section in the 'FILES' section of the man page:
/etc/tags, $HOME/.clusterssh/tags
Very similar to cluster files but the definition is reversed. The format is:
<host> <tag> [...]
This allows one host to be specified as a member of a number of tags. This format can be
clearer than using clusters files.
Extra tag files may be spcieid either as an option (see "tag-file") or within the users
$HOME/.clusterssh/config file (see "extra_tag_file" configuration option).
NOTE: All tags are added together
The version of cssh I'm using is 4.02_03
Oops. That's what I get for going through a 3rd party for documentation :\
I assume that when they say "All tags are added together," they mean that the same tag can exist in both the clusters
and tags
files, and that the resulting set of hosts will be a combination of the tagged hosts from both files. Is that correct?
I just did a quick test, and I can confirm that the two files are indeed combined like you said.
If a machine appears in the same group in both files, it is opened twice when running clusterssh <tag>