Prasanna Natarajan

Learning and Using Ansible to Deploy Sites

For a long time, I was meaning to never do server configurations manually. Since I knew Chef from a previous client work, I was hoping to use it to automate, as first steps, my * family of static sites.

But it wasn’t easy to get started with chef-solo. There wasn’t any proper “Getting Started” guide.

So I was browsing through the alternatives, and quickly found I like Ansible, mainly because it’s mostly just yaml.

It is also less complex than Chef. Chef has a bunch of tools/terms under its belt. Recipe, cookbook, librarian, knife, solo, kitchen, attributes etc. And chef needs to be managed as a ruby gem via bundler. I’m a ruby developer yes, but I’m not looking to adore ruby when I’m trying to wrangle servers. I want to get things done.

With Ansible, after a few hours of reading the documentation, I was ready to jump start my explorations. I was able to ping a brand new server that I had just bought in Vultr.

I then decided to ditch my long-serving $5 DigitalOcean server for the awesome $2.5 Vultr server to host my family of sites.

The final outcome I accomplished after this can be summed up like this:

If all of a sudden, zombies take over the world and destroyed a datacenter where my sites are served, then I’ll do these:

After that, every time I have to publish a new post or edit or remove any content, I’ll just have to run the deploy playbook once again to get the changes on server.