title: YAML inventory parsing error
body: <p><code>hosts.ini</code></p>
  <pre><code>[local]
  127.0.0.1 ansible_connection=local
  </code></pre>
  <p><code>hosts.yaml</code></p>
  <pre><code>local:
    hosts:
      127.0.0.1:
    vars:
      ansible_connection: local
  </code></pre>
  <p>then I run <code>ansible local -m ping -i hosts.ini</code> I got expected ouput, then I run <code>ansible local -m ping -i hosts.yaml</code> I got:</p>
  <pre><code>[WARNING]:  * Failed to parse /home/elruso/projects/ansible/hosts.yaml with ini plugin: /home/elruso/projects/ansible/hosts.yaml:5: Expected key=value host variable assignment, got: local
  [WARNING]: Unable to parse /home/elruso/projects/ansible/hosts.yaml as an inventory source
  [WARNING]: No inventory was parsed, only implicit localhost is available
  [WARNING]: Could not match supplied host pattern, ignoring: local
  [WARNING]: No hosts matched, nothing to do
  </code></pre>
  <p>According to <a href="http://docs.ansible.com/ansible/latest/intro_inventory.html#hosts-and-groups" rel="nofollow noreferrer">docs</a> I can use yaml files as inventory without problems. How can I specify to use the yml plugin?</p>
  <pre><code>$ansible --version
  ansible 2.4.0.0
  config file = /home/elruso/projects/ansible/ansible.cfg
  configured module search path = ['/home/elruso/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/elruso/.virtualenvs/ansible/lib/python3.6/site-packages/ansible
  executable location = /home/elruso/.virtualenvs/ansible/bin/ansible
  python version = 3.6.2 (default, Jul 20 2017, 08:43:29) [GCC 5.4.1 20170519]
  </code></pre>
  <p><strong>Update</strong>: <a href="https://github.com/ansible/ansible/issues/30977" rel="nofollow noreferrer">issue</a> opened</p>