Vagrant and Ansible facts

3

3

Is it possible to have Ansible display facts about a Vagrant box?

The Ansible documentation uses

ansible hostname -m setup

even if I connect with the Vagrant user I would still need the SSH key to connect to the Vagrant box.

user227470

Posted 2015-06-27T11:44:47.773

Reputation: 101

Answers

7

Solved, Using Vagrant and Ansible, Running Ansible Manually

ansible -i hosts default -m setup --user vagrant \
    -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \
    --private-key=.vagrant/machines/default/virtualbox/private_key

user227470

Posted 2015-06-27T11:44:47.773

Reputation: 101

0

I just ran it locally in vagrant instead.

ansible all -i localhost, -c local -m setup

Kit Sunde

Posted 2015-06-27T11:44:47.773

Reputation: 2 171