Ansible/Vagrant/Static Inventory
From charlesreid1
This page covers how to manage a static inventory file (a.k.a., hosts file, Ansible/Hosts) for Ansible, maintained by hand, if you are using Ansible with Vagrant (Ansible/Vagrant).
Vagrant: managing a static inventory file
Edit playbooks/hosts and include details about each vagrant host.
Use the command vagrant ssh-config to get these details.
Example:
$ cat playbooks/hosts myvagrantbox ansible_host=127.0.0.1 ansible_port=2222 ansible_user=vagrant ansible_private_key_file=.vagrant/machines/default/virtualbox/private_key
Your vagrant boxes should be up and running with the vagrant up command.