Part 9 – Ansible Roles

As of now we have written playbooks that include all the details like hosts, variables, tasks and plays. This is not an ideal way if we have many tasks and lots and lots of plays to be included, the best way to do it is to separate each item into its own directory and this is how its done in prodution especially if a organization use cloud. So let’s do some Role things. Continue reading

#include, #main-yml, #roles, #roles-structure

Part 8 – Ansible Play Recap, vars, Notify, Handlers

PlayBooks are a great thing, but how are we going to handle exceptions, what about errors during the tasks? what if we want to specify a condition before executing the task? How are we going to declare variables? This post is for those things. Continue reading

#handlers, #limit, #notify, #recap, #vars, #when

Part 7 – Ansible Tasks, Plays, PlayBooks

PlayBooks is the term used in Ansible to represent a configuration management scripts written in YAML. Tasks are the operations that needs to be done on the remote machines, hosts are the remote machines on which the tasks are to be executed. Tasks are always associated with hosts and this together is called a Play. PlayBook is a collection of such Plays. Continue reading

#gather_facts, #play, #playbooks, #tasks

Part 6 – Ansible Modules

Modules are packages that can perform a set of operations on remote hosts based on the arguments given. Without knowing much about modules, we have already used a “ping” module to test our ansible lab configuration. Without any further do, let’s understand Ansible modules in a bit detail. Continue reading

#ansible-doc, #copy, #modules, #service, #yum

Part 5 – Ansible Config

Ansible config file has the default settings that most users are ok to run with. However the settings can be modified like the number of parallel tasks to run at a time, default location of inventory, jinja2 extensions, log_path, private key file and so on. Continue reading

#etcansible, #ansible-cfg, #host_key_checking

Part 4 – More about Inventory File

We know a little about inventory file as of now, like, it has the list of hostnames that a controller node could communicate with. But, there is a lot a inventory file can do and we in this post will touch a bit on some of the features. Continue reading

#group_vars, #host_vars, #inventory-file, #variable-scope-and-precedence

Part 3 – Understanding our First Ansible Command

Technically, we have already run our first ad-hoc command in ansible in our previous post. In this post we will actually understand the command we ran. Since this is the format we in fact use through out our entire Ansible journey, it is good to understand this clearly.

Continue reading

#ad-hoc-command, #ansible-usage