From charlesreid1

(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...")
 
No edit summary
Line 1: Line 1:
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]]).


==Vagrant: managing a static inventory file==
==Managing a static inventory file using Vagrant boxes==


Edit <code>playbooks/hosts</code> and include details about each vagrant host.
Edit <code>playbooks/hosts</code> and include details about each vagrant host.
Line 16: Line 16:


Your vagrant boxes should be up and running with the <code>vagrant up</code> command.
Your vagrant boxes should be up and running with the <code>vagrant up</code> command.
==Flags==
[[Category:Ansible]]
[[Category:Vagrant]]

Revision as of 01:37, 11 November 2018

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.

Flags