Member-only story

Getting started with Ansible using Vagrant

Akshay Sinha
5 min readJan 27, 2019

--

Vagrant is an wonderful tool if you have a need to provision throw away development envs every now and then. I usually use vagrant to provision vm locally for any new poc that I am working on and once all looks good locally, I can choose to throw away the local setup or archive it for future use.

Ansible is an python based, agent less, automation engine which is use to automate configuration management across various hosts remotely and securely.

Since vagrant gives me the option of spinning off throw away vms on the fly, its a good fit if you are testing waters out with ansible. Enough talk, lets dive in

Prerequisites

Setting up VM’s

Create following Vagrantfile in your workspace :

As can be seen here, I am using centos-7.4 box as my base image. That was the latest version of centos that was available at the time of writing this. Another thing to note above is that I have assigned seperate ips and forwarded ports to each box. I like to keep it that way because if you are someone like me who likes to login to these VM's remotely, doing this makes it really easy.

--

--

No responses yet