curl https://gist.githubusercontent.com/xenithorb/c50fd8b22b0d0a852d4f08b40c2fccf/ansible-ssh.sh >> ~/.bashrc
. ~/.bashrc # Or open a new shell
Then, move to a directory with an inventory defined in ansible.cfg
(most projects will have you define that per-project)
Basically, ansible-inventory --list
needs to output vars when you're in your playbook directory for this to work
If it does you can now:
$ ansible-ssh <tab>
$ ansible-ssh host-<tab>
host-1
host-2
host-3
host-4
$ ansible-ssh host-4<enter>
[foo@host-4]$