Tuesday, January 14, 2014

Book Review: Ansible Configuration Management

Ansible Configuration Management [0]

TL;DR - Buy the book, it's good.

    This book is a great resource for any Linux administrator currently looking for a really well written, brisk paced walk through of Ansible[1][2]. I don't want to call this book an introduction to Ansible because there is a lot of Ansible coverage packed into these 92 pages, but at 92 pages I suspect most would expect it to be light on the goods but that is far from the truth. This book does a great job packing plenty of information into a small package.

    Ansible Configuration Management starts off describing what all will be covered, the tools you need to make real use of the text, who this book is for, as well as the standard items you would find in the Preface of a book such as typographic conventions and the like.

    Chapter 1 - Here the author kicks off with coverage of various installation methods including distribution specifics going through package managers, from pip, and coverage of how to install from the Ansible source code. From there we go into setting things up and an introductory example just to get your feet wet. Here is where I think my favorite part of Chapter 1 happens, the author covers ansible-doc which is something I feel is an extremely useful component of Ansible and I'm glad the author brought this up so early in the book to highlight reference material before diving in too far.

    Chapter 2 - The author takes us through the paces of what is known as a Playbook in Ansible vocabulary which is how you group sets of tasks together to be reusable. I really like the approach that is taken, each section of the Playbook is broken down with an explanation along with discussion of what makes different aspects useful in actual use cases. Then we are taken through some of the basic staples in Ansible space in the form of modules. The modules covered here are what I would consider "task modifiers" for lack of a better term, these allow for modifying tasks behavior based on conditions we set on the task or just simply because the we wanted to mix it up. Again I feel the author does a good job tying the content back to real world examples that many admins experience the need to solve.

    Chapter 3 - In this chapter we build on top of the material covered in Chapter 2 by covering more advanced topics in the realm of playbooks such as looping, conditional execution, task delegation, inventory variables, environment variables, external data lookup, storing results, and debugging playbooks and more. Once again, I'm going to sound like a broken record but I feel like the way the author doesn't just go on an academic discussion of each topic but actually ties it into an actual use case or administration task to demonstrate how the specific feature can solve a problem for you which is again beneficial. The discussion here is solid and was an enjoyable read.

    Chapter 4 - This is where the author wraps all the previous topics together in a chapter titled "Larger Projects." This is something I'm a big fan of and one of the reasons I think that even in the short length of the book the author does a great job of breaking past the realm of introductory topics. Here we are brought through how to handle large projects of Ansible playbooks to manage complex infrastructure. This chapter walks through Includes, Task Includes, Handler Includes, and Playbook Includes. Now on to one of my favorite features of Ansible: Roles. Our author takes us through what and Ansible Role is, including some interesting notes on parsing precedence, and how to make use of them. One thing I had mixed feelings on here in this chapter is the coverage of "New Features in Ansible 1.3" as I worry this will show the books age quickly with the release cadence that the Ansible project maintains. However, the coverage in that section as well as the rest of the book's text will remain useful I'm sure for some time to come as Ansible is continuing to add features but not break compatibility as newer versions roll out. Next our author discusses ways to increase speed of Ansible runs using different techniques based on requirements and use cases as well as covering Ansible's pull mode which is something to take note of. Ansible pull mode is often considered "backwards" in Ansible lore as Ansible is primarily a "push mode" system but some SysAdmins/Ops folk still prefer the pull mode and therefore Ansible provides the functionality and our author takes some time to cover how to utilize it.

    Chapter 5 - Custom Modules, here our author takes some time to discuss what an Ansible module is in terms of implementation, then shows how to write a simple module in the bash shell scripting language. Moving on our author shows how to write an Ansible module in Python which is what I would consider to be "native" to Ansible as all modules that are to be accepted into Ansible core must be written in Python. There is good discussion here about the integration points of the modules into the Ansible system as well as how data is passed, how debugging information is handled, and much more.

All said and done I would recommend this book to anyone interested in Ansible and would like a well written guide to walk them through from zero to being useful configuring and deploying infrastructure services using Ansible as well as writing custom modules.

Hope this helps someone out there.

Happy hacking.


[0] - http://www.packtpub.com/ansible-configuration-management/book
[1] - https://github.com/ansible/ansible
[2] - http://www.ansibleworks.com/

    I was approached by PacktPub to review this book, I was given a free copy in exchange for doing the review. I did however really enjoy the book and as a side effect I purchased a copy to support the author for their work.

No comments: