From charlesreid1

Revision as of 01:36, 11 November 2018 by Admin (talk | contribs) (Created page with "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 (Ansibl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.