Ansible for an absolute beginner

vikas yadav
DevOps Dudes
Published in
3 min readMar 26, 2019

Making automation easy

Today’s IT architectures are complex, built on multiple platforms and technology stacks. Tech community came up with new practices such as DevOps, Automation and configuration management to overcome the obstacles faced due to the complexity and outdated business practices.

It is always a good idea to understand the why before the How, so let’s have a look at each of the terms I have mentioned above before we move on

  • Automation is the act of automating a manual process, for example, monthly restart of your servers
  • DevOps concept increases the collaboration between software development and operations teams by automating infrastructure, workflows and continuously measuring performance
  • Configuration management maintains your managed systems such as servers in the desired state using automation tools like Ansible.

Now, as you might have guessed from the above that Ansible is a configuration management tool or more specifically a push-based configuration management tool.

But hang on, that's one new term so let's examine that

Configuration management tools come in two flavors

  • Push-based tools like Ansible have a central controller that pushes the new configuration to managed servers. These tools are agentless.
  • Pull-based tools: managed servers pull their configuration from a central server using an agent installed on the client.

Ansible being a push-based configuration management tool is agentless and uses passwordless ssh to connect to managed server(s) and execute its playbooks which are written in YAML

Wait... you’ve used more terms that I don't know.

I know, I know.. Don't worry, here are some common terms used in Ansible:

  • Control Node: Any machine with Ansible installed. You can use any computer that has Python installed on it as a control node — laptops, shared desktops, and servers can all run Ansible. However, you cannot use a Windows machine as a control node. You can have multiple control nodes in your environment.
  • Managed Nodes: The network devices (and/or servers) you manage with Ansible. Managed nodes are also sometimes called “hosts”. Ansible is not installed on managed nodes.
  • Inventory: A list of managed nodes. An inventory file is also sometimes called a “hostfile”. Your inventory can specify information like IP address for each managed node. An inventory can also organize managed nodes, creating and nesting groups for easier scaling.
  • Modules: The units of code Ansible executes. Each module has a particular use, from administering users on a specific type of database to managing VLAN interfaces on a specific type of network device. You can invoke a single module with a task, or invoke several different modules in a playbook. For an idea of how many modules Ansible includes, take a look at the list of all modules or the list of network modules.
  • Tasks: The units of action in Ansible. You can execute a single task once with an ad-hoc command.
  • Playbooks: Ordered lists of tasks, saved so you can run those tasks in that order repeatedly. Playbooks can include variables as well as tasks. Playbooks are written in YAML and are easy to read, write, share and understand.
  • YAML: YAML is the abbreviated form of “YAML Ain’t markup language” is a data serialization language which is designed to be human -friendly and works well with other programming languages for everyday tasks.

Click here to read part 2 of this story

To know more about YAML check my story Write your first YAML.

I have a youtube channel where I upload high-quality IT-related content for free. Please feel free to have a look at my other free courses and subscribe to my channel.

Here is a link to my free 3-hour Ansible masterclass on youtube.

If you wanna learn advanced concepts of Ansible such as different types of variables and how to use them, setting your own event handling system in Ansible, etc, here is a heavily discounted coupon for my course on Udemy “Ansible for an absolute beginner”.

--

--

vikas yadav
DevOps Dudes

IT engineer with 14 years of experience in IT with recent experience in Solution design, Big data, and log analytics.