Tuesday, December 17, 2013

Another reason why having a configuration tool to build servers is a good idea

Forgive me reader, it's been a month since my last post. Sorry about that.

At work we've got Ansible.  It rocks. If you build servers by hand you have my sympathy, and stop doing that.  Check this out:

I have hypervisors running Proxmox. Which is openvz with frills.

On these hypervisors, I have a whole lotta containers. Two containers are 32-bit Ubuntu, 4gb of RAM. Found out today, at lunch, I need them to be 64-bit Ubuntu with 8gb of RAM.

Not very long ago, this would be a big deal, involving a lot of money, and time and frustation. Today I simply did this:

  • Stop and delete the old containers. 
  • Edit a file.  Change MEM=4096 to MEM=8192. Change OS=ubuntu32 to OS=ubuntu64. 
  • Run a shell script - answer the prompts. There are four of these. 
  • Shell script runs an Ansible playbook, which is a yml file telling Ansible what to do. 
  • Sit back and watch Ansible do it's thing. 
  • Five minutes later I have two new servers, the application is deployed and running. 

The book keeper wandered up.  I gestured: look!  She started at my terminal, printing line after line of text telling me what Ansible is doing to my server.  What ..

'My life-long ambition to reduce my job to pushing a button once in a while is coming to fruition! Muh-ha-ha!'

She gave me a 'bless your heart' [1] smile and warily backed away.  No doubt she was looking for a sharp stick in case I got out of hand ...

I love what I do for a living.

I need to point out that none of this Just Happens: The playbook that builds the container is a 2nd or 3rd generation playbook here.  It works well because we have done the hard work of making playbooks that didn't work so good.  At least my playbooks were lame and clunky.

An astute observer would also notice that the process does not yet do a very good job of editing proxmox container values on the fly.  That is I _should_ be able to edit the MEM value and rest easy knowing that Ansible will make that change for me.  It doesn't do that, yet, but I have plans ...

Also I would be remiss if I did not point out that there is a team effort at work here and my contributions are very much built on the platform I inherited when I arrived.  If I'm any good with these tools it's because the guys I work with did a great job of setting them up.

[1] Most of my readers may know this is Southern for 'You are insane and bear watching'.