Ansible as an alternative to the Puppet configuration tool

Big and Small

Extensions by Module

Admins can use Ansible modules to run their own specific commands on the hosts (Figure 4). Modules are small programs that Ansible copies to the target hosts in the scope of an Ansible run. When the commands arrive on the host, they are executed and then finally deleted. Unlike Puppet, which preferences the Ruby language, Ansible lets you write modules in any language – the only condition is that the modules deliver their output in JavaScript Object Notation (JSON) to the target host.

Figure 4: Modules let administrators run arbitrary commands on Ansible target computers.

Modules let you manage almost every aspect of the Ansible configuration. For instance, if you are not satisfied with SSH execution, you can move to a different transport module so that Ansible can run its commands on the target hosts.

Prebuilt Playbooks Abound

Puppet and Ansible both support large communities that take care of authoring manifests and playbooks for virtually any task. Like Puppet, Ansible offers a complete solution for deploying OpenStack in a meaningful way [7]. US hosting service provider Rackspace maintains the code required for this OpenStack support. Although you won't find an Ansible Forge, searching on Google with the required keywords will typically turn up lots of options for third-party Ansible modules and add-ons.

In addition to its strong Linux support, Ansible runs on BSD, and Ansible can also handle Windows PowerShell commands.


Ansible impresses in a direct comparison with Puppet for routine configuration tasks. First and foremost, you have to consider the tool's performance. A Puppet agent in a typical setup with a Puppet master will first download the entire configuration from the master and store this configuration in the local cache – and this takes time.

Then a number of seconds are required for the Puppet master to generate a complete manifest for a host when called on to do so. It is only then that the manifest is executed – and again, this can take a number of minutes, especially in the case of larger manifests. Ansible is far quicker at processing the outstanding tasks once it is up and running.

Ansible playbooks are clear and structured – you can understand them if you have had very little experience with Ansible. The fact that Ansible does not even attempt to become a configuration converter like Puppet and Hiera is something for which the developers deserve much praise. Templates are authoritative in a typical Ansible playbook.

In light of all this euphoria, note that Ansible has not been around for nearly as long as Puppet. If you are used to working with Hiera in Puppet and enjoy the experience, you will probably find the structure of the Ansible playbook unnecessarily redundant.

Will Ansible retain its refreshing simplicity as it continues to evolve and gain new features? Only time will tell, but for now, if you want a lean alternative to Puppet, you will probably find what you are looking for with Ansible.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus