0

My experience using Ansible for deployment

When I moved to a new server infrastructure and host for Simplero around the new year, I decided I wanted system to manage the setup, so that the configuration of my servers would be defined in code I can check in to github, rather than just a collection of stuff on the server that happens to work, but no-one really remembers exactly what was installed or how or where. Replication and documentation. Important stuff.

I looked at a couple of different options. I looked at Chef and Puppet, which seems to be two of the big boys. I think I also looked at a few others, besides the system I ended up choosing: Ansible.

I like the idea behind Ansible. You don’t need a daemon on the server. Everything is done over SSH. There’s no magic (or at least not too much). Everything is defined in simple plaintext files that you cane easily manage. 

In practice, though, I find that Ansible gets in the way more than it helps. I find that I spend 90% of my time trying to figure out how to get Ansible to do what I want, and about 10% of my time working on what I actually want to accomplish on my server.

So rather than just run a couple of commands, see if they did what I wanted them to, and if not, doing something else, I now spend most of my time trying to convince Ansible to run those commands for me in a meaningful way. And each time, I have to run the entire playbook in order to test one step at the end.

It also bothers me that almost all of the files end up being named the same. They’re all main.yml. It’s the location of the file that matters. That makes it super confusing to edit my scripts when you need to work with several of these files at the same time, because all of the tabs in my editor are labeled the same.

I haven’t found a system I like better (I haven’t looked, either). I’m staying with Ansible for now, because it would be way more work to try and replace it at this point, especially since I don’t know what I’d replace it with.

I just wanted to write this post so that if people are searching for experiences about using Ansible, they’d have this perspective too to take into consideration. Just trying to be helpful here.

Have a super duper day.

4 comments

Jonathan Drake
 

Docker?
Read more
Read less
  Cancel
Calvin Correli
 

I tried docker first but that was even more work and overhead just to get services to talk to each other. Overkill for my needs.
Read more
Read less
  Cancel
Mxx
 

You should use tags in your playbook tasks and then run only those tags. That way you don't have to go through the whole playbook over and over. Depending that editor/IDE you use, pretty much all of them should support displaying tab name with full/relative path of your files.
Read more
Read less
  Cancel
Calvin
 

Thanks, will check out using tags. File names/tabs: Sure, but that also means bigger tabs = less number of tabs.
Read more
Read less
  Cancel

Leave a comment