Showing posts with label ansible. Show all posts
Showing posts with label ansible. Show all posts

Sunday, March 16, 2014

Continuous Integration and Deployment with Github

[CODE]


Jenkins:


I didn't have good experience with Jenkins. In summary, something caused Jenkins to crash and I had to reinstall again... I repeated a few times and I decided that this should be done by someone else.
So I then went for hosted Jenkins. It was better but things weren't working everything perfectly just yet especially when creating test database.


I need super easy way to achieve Continuous Integration:


My co-worker mentioned that people at one conference was raving about codeship. Tested out free subscription. It is ridiculously simple and intuitive (just like when I found ansible while I was struggling with puppet). Best of all, there is small "?" button on bottom right corner and you can ask questions when you stuck and knowledgeable engineer would respond to you within 24 hours or so. Just fantastic.

Now to achieve Continuous Deployment:


What I end up doing is to setup deploy server which runs small flask (python micro framework) application and listens one type of request which is POST request from Github Webhooks.
Flask app will read payload from github and trigger ansible deployment script (via fabric) if commit / merge is made to master.
Once deployment is completed, it will post to private twitter account (this piece of code also on fabirc which is wrapper to ansible) that our team subscribes. The post message includes dev's commit message as well. I like this so far.
Because we are python shop and this approach will give us not only flexibility but ability to debug any issues easily.


Saturday, February 15, 2014

Server Provisioning Tools


What's Ansible?

per ansible:

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

With vagrant, bringing server up from scratch and running with same state was just ridiculously easy.

Why did I choose Ansible over other tools?

My qualification and situation when I chose Ansible:


I am in an ultra time crunch right now but need to have provisioning tools up and ready in a few days
I am a developer and not full time sysadmin but I have administrated servers for last ten years mainly software level and nothing network level
I am proficient in shell and python

Process of selecting tools:

Quick Lookup: according to this article, SaltStack is rated #1 then puppet, chef and ansible... but ansible is simpler tool than puppet or chef. I like simple than complex...

Attempt 1: Last time I went to Django Conf, peopler were raving about SaltStack. So that was the very first one I tried. Installing software was easy. Test against localhost was successful. Attempt to talk to Server was not so successful and error wasn't verbose enough (I probably didn't know how to make it verbose) but I quickly moved off to seek tools that give me obvious error message.

Attempt 2: So next simple tool would be ansible. Yes. things are up and running in matter of 10 min. Amazingly easy to use. With -v option, error is verbose and clear and even give me tips how I may fix it. Plus amazing community. I posted question and got an answer within a few hours and solved the problem I was stuck on.

Our Ops wanted to use puppet because of robustness so now I am giving try puppet

Attempt 3: Installation of regular puppet required me to install 3 sets of DMG for osx whereas ansible, you just need pip install of a few packages.

Standard puppet seems to be fine. pp file extension was recognized by my favorite IDE Pycharm so I was pretty happy about it.

We wanted to bring up server (not just provisioning) with puppet which requires enterprise version. Ops setup PE (puppet enterprise) server but I have no idea where I go from here... in order to issue "puppet node_vmware create"

This enterprise version was confusing (for Unix - i use osx - 3.7GB worth of software is needed whereas for Linux you will need 300 to 400 mb of software)

So I just gave up until someone who have done can give me tip... (including watching youtube video)

Until then, my tools of choice had to be ansible with my limited knowledge (which I am very happy with)

I am planning to study puppet for next few weeks and post update. Also I will post some ansible tips.