Ansible/Vagrant/Static Inventory: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Main|Ansible/Vagrant}} | |||
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]]). | 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]]). | ||
Revision as of 01:37, 11 November 2018
Main article: Ansible/Vagrant
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).
Managing a static inventory file using Vagrant boxes
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.