When we started to use Ansible few years ago the official documentation gave us a little help because it was too far from the practical tasks we would need to solve. Usually such situation means one tries to use a tool in the wrong way but the years passed shower that was not a case but rather the area of Ansible usage is so wide there’s no possibility do describe how to solve every task with it.

With the samples from our real life playbooks i would like to describe the solutions of few practical tasks.

The essential way to use Ansible is to have the inventory of the hosts which is very good and we used to use as an implementation of our CMDB completely removing the necessity of Excel or GoogleDoc spreadsheets.

But some times we need to pass a host via the command line arguments having it not within the inventory at all. For example to quickly deploy drone.io instance to the fresh Digital ocean droplet there’s a playbok with the stansa

So

let us turn the clean linux box into CI/CD server in minutes without spending time editing and syncing the global inventory.

The fetching the values from the environment variables is suitable not for just setting hosts

The next trick is to switch to the specific user is well known

And here the self-explained list of tasks:

Categories: DevOps

Leave a Reply

Your email address will not be published. Required fields are marked *