when the nodes are deployed, whirr list the ssh commands needed to get to each host.
What it doesn't do is list the roles, so you either have to log in and check, or rummage through the logs above to work this out.
I propose listing each role, so you'have
[hadoop-jobtracker] ssh user@host2
[hadoop-namenode] ssh user@host