title: packer + ansible, how to specify the inventory file
body: <p>When I use vagrant, I can specify the inventory file in the Vagrantfile.</p>
  
  <p>Example:</p>
  
  <pre><code>config.vm.provision "ansible" do |ansible|
      ansible.playbook = "my_folder/playbook.yml"
      ansible.inventory_path = "my_folder/inventory_file"
  end
  </code></pre>
  
  <p>How can I configure the inventory_file when I use packer?</p>
  
  <p>I can't see any related info in the official documentation of packer:</p>
  
  <p><a href="http://www.packer.io/docs/provisioners/ansible-local.html" rel="noreferrer">http://www.packer.io/docs/provisioners/ansible-local.html</a></p>
  
  <p>I need specify the inventory file, because, when I run my packer.json, this is the output:</p>
  
  <pre><code>digitalocean: Executing Ansible: ansible-playbook /tmp/my_folder/playbook.yml -c local -i "127.0.0.1,"
  digitalocean:
  digitalocean: PLAY [foo] ******************************************************************
  digitalocean: skipping: no hosts matched
  </code></pre>
  
  <p>Packer seems using a inventory file named "127.0.0.1,", and I don't know why.</p>
  
  <p>How can I specify my inventory file?</p>
  
  <p>Thanks!</p>