1

I'm building a multi-server e-commerce website using Django and PostgreSQL. I'll be utilizing multiple servers (app, database, static, etc.) from Linode.

Currently I configure my servers using a collection of Bash scripts I wrote. Writing these scripts helped me understand how everything connects together but now my infrastructure and stack have now become complicated enough that using these scripts has become difficult and error-prone. I'd like to switch to Ansible instead.

If I'm going to use Ansible to provision my servers, should I also be using Vagrant?

In other words, should I use Ansible to provision my bare metal hardware or is it understood that if you're using Ansible, you should be provisioning your server on a Vagrant VM too? And if I do this, will there be any performance hit to running my site in a VM rather than on the server itself?

6
  • 7
    There's no connection between Ansible and Vagrant; neither requires the other. Just out of curiosity, I would like to know which crappy Internet tutorial gave you that idea. :) Dec 29, 2015 at 20:16
  • Out of respect to the podcasters and bloggers who gave me this idea, I'll let them remain anonymous. I guess my real question is: would it be advisable to run my application inside a Vagrant VM? If I need to modify or update things, I'd think it would be cleaner to delete and rebuild the VM and leave a "pristine" server underneath than have to rebuild the server itself. But is there a noticeable performance hit if I do that? Thanks.
    – Jim
    Dec 29, 2015 at 20:23
  • 1
    You're on Linode; it's already a VM! I don't see any need for Vagrant here anyway, whether it was a VM or not. Dec 29, 2015 at 20:25
  • OK, thanks Mike. As I said, I'm new to dev-ops and I realized this might sound like a stupid question when I wrote it. But we all have to learn someplace. ;-)
    – Jim
    Dec 29, 2015 at 20:26
  • 4
    @Robert I suggest you un-learn the term "devops." Nothing you have spoken of in this question is "devops." The term is bankrupt, poorly applied, and has no meaning. What you're doing here is systems administration and/or systems engineering (depending on your country's use of the term 'engineer' and 'enringeering').
    – Wesley
    Dec 29, 2015 at 20:28

1 Answer 1

1

While Vagrant and Ansible work very nicely together, as mentioned in comments to your question, the use of either of these tools does not require the use of the other. Ansible is perfectly usable without Vagrant and Vagrant, as documented here, can use over 10 other configuration methods, including other config management systems(chef, puppet, salt).

There is some overlap in functionality between Vagrant and Ansible. For example both projects can create servers. Ansible supports a number of cloud service providers and virtualization systems as documented here. Similarly, Vagrant supports some providers as well.

Vagrant is best at creating servers, and especially (local) VMs.

Ansible is a much more general-purpose tool. As you are aware, besides creating servers, you can also configure and orchestrate them. You can use Ansible to deploy your application code, manage networking devices and many other use-cases.

The benefit of going with Ansible-only approach is that you have one less dependency in your toolset...You need only Ansible. The drawback is that you'll need to figure out the nuances of creating servers for your intended platform. That can complicate your roles/playbooks.

The benefit of using Vagrant for provisioning is it might be a simpler to create servers regardless of what platform you use to run them.

A very common use-case is people use Vagrant to spinup local development VMs. This allows them to use the same Ansible playbooks to configure/deploy dev, qa and prod environments. This helps address a common problem of "worked fine on my local dev" situation where a local dev computer might have different configuration or even OS relative to qa and production environment. Running a VM allows you to use the same OS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .