Ansible + Vagrant question please

I want to create a Virtualbox VM and provision it.

Now I can run:

vagrant init bento/centos-6.7; vagrant up --provider virtualbox

And it's there.

I can put this command as a local command in Ansible, but I gather there is a Vagrant module as well, which is probably more involved.

Is there a good reason why I should grok the Vagrant module to do this when a simple command will do?

I prefer that it looks more professional and robust, and not so "hacky" but simple is good.

Thanks

Test Kitchen is a great way to test virtualbox instances, and here is an ansible provisioner: https://github.com/neillturner/kitchen-ansibleThat will both launch and provision the machine.

Or, configure ansible directly in Vagrant: http://docs.ansible.com/ansible/guide_vagrant.html . In this case, you would still need to start and stop the vm, as you had written.

For single machine, Vagrant’s built in ansible provisioner is good. For multi-machine, you could consider using the dynamic inventory (slooow), or better, just source a configuration file (json, yaml, csv, ini, whatever) from the Vagrantfile and from a dynamic inventory.

I created some example scenarios where, Vagrant, Shell Scripts, and Ansible dynamic inventory from a config file (one source of truth):

The only draw back, is that it doesn’t reflect current state of the systems (that they are running), only that they are configured to run, and how to access them through Vagrant’s private key.