bypass the need for ansible hosts file

Actually, there is a way. It may not be the way you want. If you
want to ignore the host file, you can, like so.

ansible-playbook foo.yml -i "hostname1,hostname2"

The only catch is if there is only one hostname, so that it knows it
is a list and not a filename, the "-i" argument must end in a comma:

ansible-playbook foo.yml -i "hostname1"

The reason we don't allow unknown hosts straight up as there isn't a
good way to tell what's a group, what's a typo, and what is a
hostname.

Thus we don't want to try to connect to a group as if it were a
hostname if the groupname were mispelled. Ansible will actually
warn when no hosts are matched in a play.

so basically, the OP can have its way by putting this in his .bashrc:

Run ansible on custom hosts

ansibleh() {
hosts=$1
shift
ansible -i ${hosts}, all $*
}

Serge

It would look a little different for ansible-playbook, but yes.