title: Vagrant->Ansible: Host file not found, provided hosts list is empty, no hosts matched
body: <p><strong>Background:</strong> I frequently end up working on different laptops running on different operating systems. This means I waste a lot of time re-installing the same programs and applications.  I've decided to try and automate this using Vagrant and Ansible. </p>
  
  <p><strong>Problem:</strong> As I want this build to be deployable on a range of operating systems I want Vagrant to spin up a simple <code>ubuntu/trusty64</code> box, and Ansible to be installed and execute on the Ubuntu box, however I'm having trouble with the Ansible hosts. I've read the Ansible docs and have read about inventory however haven't found it very clear how these work or where this should be defined in my  setup. For reference I'm new to both Vagrant and Ansible but have experience with VirtualBox.  Any help would be much appreciated</p>
  
  <p>Stack trace here:<a href="https://i.stack.imgur.com/a8beD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a8beD.png" alt="stacktrace"></a></p>
  
  <p>Vagrantfile:</p>
  
  <pre><code># -*- mode: ruby -*-"
  # vi: set ft=ruby :
  
  # vagrant plugin install vagrant-ansible-local
  
  VAGRANTFILE_API_VERSION = "2"
  
  $ansible_install_script = &lt;&lt;SCRIPT
  if ! which ansible &gt;/dev/null; then
    apt-get update -y
    apt-get install -y software-properties-common
    apt-add-repository -y ppa:ansible/ansible
    apt-get update -y
    apt-get install -y ansible
  fi
  SCRIPT
  
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.define "dev-machine", primary: true do |machine|
      machine.vm.box = "ubuntu/trusty64"
      machine.vm.hostname = 'local.dev-machine.box'
      machine.vm.network :private_network, :ip =&gt; '10.20.1.2'
  
      machine.vm.provider "virtualbox" do |vb|
        vb.gui = true
        vb.memory = "8192"
      end # vb
  
      machine.vm.provision "shell", inline: $ansible_install_script
  
      machine.vm.provision "ansibleLocal" do |ansible|
        ansible.guest_folder = "/vagrant-ansible"
        ansible.raw_arguments = "--inventory=/vagrant-ansbile/ansible_hosts"
        ansible.playbook = "playbook.yml"
        ansible.limit = "local.dev-machine.box"
      end # ansible
    end # machine
  end # config
  </code></pre>
  
  <p>playbook.yml:</p>
  
  <pre><code>---
  - hosts: all
    become: yes
    become_method: sudo
    tasks:
      - name: Check Ubuntu 14.04 running
        assert:
          that:
            - ansible_distribution == 'Ubuntu'
            - ansible_distribution_release == 'trusty'
  
      - name: update apt cache
        apt: update_cache=yes
  
      - name: install git
        apt: name=git-core state=latest
  
      - name: Install Python 3.4
        apt: name={{items}} state=latest
        with_items:
          - python
          - python-dev
          - python-virtualenv
          - python-setuptools
          - python-pip
  </code></pre>