Nodejs, Ansible and Cloudstack Deployment

This might be a strange combination but I was looking for an easier more repeatable way of installing and setting up the foundational components of Apache CloudStack. It’s the evolution of all things right? You typically have to crawl before you walk and walk before you run. I started this adventure of automating my processes and configurations with Saltstack. Saltstack is a great configuration management and orchestration solution. While Saltstack started off to be well suited for what I try to accomplish, it soon started to get more involved than I wanted it to be. I do think Saltstack would cover 100% of what I want in the big picture as it supports Windows and Linux but I was more focused deploying CloudStack infrastructure. I suggest you look into Saltstack if you’re looking for a serious alternative to puppet.

Then there was Ansible. I have heard of Ansible but I’d never actually tried before this past week where I had a four-day weekend and I seriously wanted to get more traction on getting this task done. Ansible is also gear around automation and configuration management in much the same way as Saltstack but it’s much simpler to work with and understand. The one main difference is that Ansible leverages ssh and does not use an agent. Saltstack can leverage ssh as well with salt-ssh but I was not feeling it at that time, not to mention ansible-playbooks would give me the best of both worlds without an agent. I was literally able to get more done in 30 minutes with Ansible than I could with Saltstack in a day never having used it before. It really was a case of using the right tool for the job and for this job Ansible seemed to fit better.

Nodejs came into play when I quickly needed an internal repo server for the CloudStack packages. My only complaint about installing CloudStack is that the packages are really big, some sizing 60mb or more so downloading from an external repo does no good when you want speedy installations but this is nothing new. I did not want to setup complicated systems in environments that did not already have solutions for this either, which is why nodejs came into the picture. Nodejs provided the quickest solution that was portable and could be started and stopped easily as needed.

Hopefully you were not looking to see examples in this post because by now you’d be disappointed. I wanted to clean things up first. What I was able to get working in two days of using Ansible was the installation of mysql with the option to set up replication between two servers and install and setup multiple Cloudstack management servers. Four servers in all in roughly 5 minutes time with minimal input by the user. Now all I need to do is just start the nodejs web server, add the targeted servers in the ansible hosts file and supply a few variables in the vars file then I was off and running. Completely automated and repeatable. And completely awesome!

If you haven’t tried Ansible or Saltstack try them both out for yourself. The only downside I see with Ansible is that there is no Windows support at the moment. My next steps are to get the cloudstack-agent or host setup and pre-seed the templates using ansible then what I wanted to accomplish will be complete.

ps - I found this link after going down this road. It actually helped me when I got stuck on something, i can’t remember, and since I did not give code examples with ansible @shapeblue has.