A 4-post collection

Managing Cluster With Ansible Playbooks

While ad hoc commands are indispensable for learning Ansible and executing one time tasks, playbooks are real workhorses. In this introductory post I will explain the essence of a playbook on example.

So what is a playbook?

At the first glance, it's a file written in YAML that contains a list of plays. If we look closer, we'll see that a playbook file is a mixture of configuration and script concepts. On one hand, it specifies the desired configuration of systems. On the other hand, like in a script, it defines in which order tasks must be executed in a

Read more »

Understanding Ansible Patterns

Patterns is a set of expressions in Ansible that lets us specify concisely which systems a playbook or an ad hoc command must be applied to. In this post we will consider most useful pattern expressions and demonstrate them on examples.

In examples we will use module ping, which doesn't produce much output. If you never worked with it before, ping module just pings all systems selected by pattern. Also we will make use of -o option, which condenses output to one line per system.

In general, our ad hoc commands will look like:

ansible <pattern> -m ping
Read more »

Playing With Ansible Using Ad-Hoc Commands

In previous posts we created a cluster of VMs and set up Ansible to manage the cluster. So we have a cluster of VMs ready to play with. Today we will explore Ansible with a bunch of ad hoc commands, which is the easiest way to get a flavour of cluster management.


Before going any further it's important to understand Ansible philosophy, because it drastically differentiates Ansible from similar tools.

In contrast to Puppet and other tools that automate execution of commands on remote systems, Ansible manages remote systems' state. In Ansible you specify a state that remote systems

Read more »

Setting Up Ansible To Manage Cluster Of VMs On Mac OS X

Last time we created a cluster of VMs on Mac OS X. In this post you will learn how to setup Ansible to manage the cluster.

Installing Ansible

If your OS X version is below El Capitan, follow instruction from Ansible.

OS X El Capitan introduced System Integrity Protection, which disallowed modification of system-level components. As result, official instruction from Ansible does not work anymore. Fortunately, Marc Weisel has written a nice post on how to Install Ansible on OS X El Capitan.

When Ansible is installed, let's configure inventory for our cluster.


Ansible allows to configure and install

Read more »