Its been more two years that i found ansible and have been using it at work. Ansible has become my favroute tool over time and helped me in making many of the operational tasks simple. This post is an attempt to introduce this amazing tool for some one who has never tried it before.

Ansible is automation framework that specifically targets at automating you task(work) acrros N number of nodes. Lets a simple use case of copying a single cert file or propties of a app on 10 different VM. If you have to do it normal you would have to copy all of them one by one(of course there SSH terminal that help you do it even better) but anisble lets you do decribe that task of copying a file to server in a very descriptive languge therefor making a repitable action across as many vm as possible. Not you can scale task as you like, that is you are not limited just copy a single file, but you could do 100 different task on each machine parallelly if you like.

To understand Ansible better i will take a use-case and show how to do that in an ansible. Lets say we have 10 VM given to us asked to perform follwoing task on each one of them

  1. create a new user and user to the sudoer group 1.create following directory structure /application/software/, /application/artifacts , application/software/java
  2. clone a github repository
  3. copy a file from your local machine /applicaiton/software/bin
    1. ensure the copied file content is updated correctly for each host
  4. install docker on each machine
  5. test that docker is installed correctly on each machine

Now that we have our task defined, we need a test env to work. having a good workflow helps speed up the learning process as that will allow you to do things multiple times. Please follow the site here to install multipass by canonical. Multipass allows you sping up mulitple ubuntu instance just like running docker.