{"action":"created","issue":{"url":"https://api.github.com/repos/duncs/clusterssh/issues/25","labels_url":"https://api.github.com/repos/duncs/clusterssh/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/duncs/clusterssh/issues/25/comments","events_url":"https://api.github.com/repos/duncs/clusterssh/issues/25/events","html_url":"https://github.com/duncs/clusterssh/issues/25","id":59329218,"number":25,"title":"Option to read host list from file","user":{"login":"mperry2","id":2487505,"avatar_url":"https://avatars.githubusercontent.com/u/2487505?v=3","gravatar_id":"","url":"https://api.github.com/users/mperry2","html_url":"https://github.com/mperry2","followers_url":"https://api.github.com/users/mperry2/followers","following_url":"https://api.github.com/users/mperry2/following{/other_user}","gists_url":"https://api.github.com/users/mperry2/gists{/gist_id}","starred_url":"https://api.github.com/users/mperry2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mperry2/subscriptions","organizations_url":"https://api.github.com/users/mperry2/orgs","repos_url":"https://api.github.com/users/mperry2/repos","events_url":"https://api.github.com/users/mperry2/events{/privacy}","received_events_url":"https://api.github.com/users/mperry2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-28T06:42:10Z","updated_at":"2015-03-04T15:21:13Z","closed_at":null,"body":"I often connect to groups of hosts whose membership is created from scripts and reports. Because the groups of hosts are dynamic, it doesn't make sense to put them into the .clusterssh/clusters file. I've gotten tired of typing `cssh $(cat hosts.txt)` and want something that's less work to type and will work with my bash completion.\r\n\r\nI'm going to add a feature to my local copy of ClusterSSH that will have it connect to a list of hosts in a text file (one host name per line). I'd be happy to submit a pull request if you're interested. If so, do you have a recommendation for the command line switches to use? I was planning on using `--hosts` and `-H` (taking it away from the `--man` option).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/duncs/clusterssh/issues/comments/77176820","html_url":"https://github.com/duncs/clusterssh/issues/25#issuecomment-77176820","issue_url":"https://api.github.com/repos/duncs/clusterssh/issues/25","id":77176820,"user":{"login":"duncs","id":46802,"avatar_url":"https://avatars.githubusercontent.com/u/46802?v=3","gravatar_id":"","url":"https://api.github.com/users/duncs","html_url":"https://github.com/duncs","followers_url":"https://api.github.com/users/duncs/followers","following_url":"https://api.github.com/users/duncs/following{/other_user}","gists_url":"https://api.github.com/users/duncs/gists{/gist_id}","starred_url":"https://api.github.com/users/duncs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duncs/subscriptions","organizations_url":"https://api.github.com/users/duncs/orgs","repos_url":"https://api.github.com/users/duncs/repos","events_url":"https://api.github.com/users/duncs/events{/privacy}","received_events_url":"https://api.github.com/users/duncs/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T15:21:13Z","updated_at":"2015-03-04T15:21:13Z","body":"Matt\n\nYou can have a Perl or shell script that looks at each @ARGV then looks for the file in the appropriate dir. If it exists, read the file and output the contents to stdout. If it doesn't exist just return the @ARGV entry\n\nSomething like:\n\nforeach my $b (@ARGV){\nif(-f \"$HOME/etc/$b\"){\nmy $hosts=slurp \"$HOME/etc/$b\";\nprint $hosts;\n} else {\nprint $b\n}\n}\n\nSo the cluster name you provide would be the file containing the hosts\n\nI have used this for looking up hosts from a CMDB instead of a static host file. The logic in the command can be whatever you need it to be, even looking up some cluster names in a DB, others from a generated file or wherever you have the data. You have the flexibility to look up clusters as you need\n\nLet me know if that doesn't answer your question. \n\nNot easy typing code on an iPhone :D\n\n  Duncs\n\nSent from my iPhone\n\n> On 3 Mar 2015, at 23:10, Matt Perry <notifications@github.com> wrote:\n> \n> The man page says that external_cluster_command is for specifying a command that's run. Could you explain how it would be used in this instance? All I want to do is have cssh connect to hosts listed in any arbitrary text file.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}