Issue 1:
Issue Type: Bug Report

Ansible Version:

$ ansible --version

ansible 2.0.0.2

config file = /home/xaeth/.ansible.cfg

configured module search path = Default w/o overrides

Ansible Configuration:

What have you changed about your Ansible installation?

My /etc/ansible/ansible.cfg is default Fedora version, which appears to be the stock examples cfg. My cfg changes the following:

[ssh_connection]
ssh_args = -o ForwardAgent=yes -o PubkeyAuthentication=yes

Environment:

Fedora 22

Summary:

As of v2 limiting is broken with static inventory.

Reproduction:

Using the attached inventory.txt

Ansible 1.9.4

$ ansible all --list-hosts -i inventory.txt -l 'app1'
app1-n01.dc1.dev.example.com
app1-n02.dc1.dev.example.com
app1-n01.dc2.dev.example.com
app1-n02.dc2.dev.example.com
$ ansible all --list-hosts -i inventory.txt -l 'app2'
app2-n01.dc1.dev.example.com
app2-n02.dc1.dev.example.com
app2-n01.dc2.dev.example.com
app2-n02.dc2.dev.example.com
$ ansible all --list-hosts -i inventory.txt -l 'app1:&dc1'
app1-n01.dc1.dev.example.com
app1-n02.dc1.dev.example.com

Ansible 2.0.0.2

$ ansible all --list-hosts -i inventory.txt -l 'app1'
hosts (8):
app2-n01.dc1.dev.example.com
app2-n02.dc1.dev.example.com
app2-n01.dc2.dev.example.com
app2-n02.dc2.dev.example.com
app1-n01.dc1.dev.example.com
app1-n02.dc1.dev.example.com
app1-n01.dc2.dev.example.com
app1-n02.dc2.dev.example.com
$ ansible all --list-hosts -i inventory.txt -l 'app2'
hosts (8):
app2-n01.dc1.dev.example.com
app2-n02.dc1.dev.example.com
app2-n01.dc2.dev.example.com
app2-n02.dc2.dev.example.com
app1-n01.dc1.dev.example.com
app1-n02.dc1.dev.example.com
app1-n01.dc2.dev.example.com
app1-n02.dc2.dev.example.com
$ ansible all --list-hosts -i inventory.txt -l 'app1:&dc1'
hosts (8):
app2-n01.dc1.dev.example.com
app2-n02.dc1.dev.example.com
app2-n01.dc2.dev.example.com
app2-n02.dc2.dev.example.com
app1-n01.dc1.dev.example.com
app1-n02.dc1.dev.example.com
app1-n01.dc2.dev.example.com
app1-n02.dc2.dev.example.com

Issue 2:
as described here, this doesn't work

$ ansible all -i hosts --limit ~host1 --list-hosts
hosts (10):
host1
host2
host3
host4
host5
host6
host7
host8
host9
host10

nor this

ansible all -i hosts --limit host4 --list-hosts
hosts (10):
host1
host2
host3
host4
host5
host6
host7
host8
host9
host10

but this will

ansible-playbook test.yml -i hosts --limit ~host1

PLAY ***************************************************************************

TASK [setup] *******************************************************************
fatal: [host1]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", "unreachable": true}
fatal: [host10]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", "unreachable": true}

PLAY RECAP *********************************************************************
host1 : ok=0 changed=0 unreachable=1 failed=0
host10 : ok=0 changed=0 unreachable=1 failed=0

ansible version:

ansible 2.0.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = /usr/share/ansible

installation through pip install --user ansible --upgrade.

My hosts file was generate with for f in $(seq 1 10); do echo "host$f" >> hosts; done