Book Image

Ansible Configuration Management

By : Daniel Hall
Book Image

Ansible Configuration Management

By: Daniel Hall

Overview of this book

<p>Ansible provides a clear and concise way to manage the configuration of your Linux infrastructure. It can help in making your infrastructure more maintainable, quicker to deploy, and easier to understand. <br /><br />"Ansible Configuration Management" will take you from your very first command all the way to extending the very capabilities of Ansible itself. It takes a practical approach with hands-on examples, which ensures that the readers walk away with all the knowledge and skills they will need to harness Ansible.<br /><br />"Ansible Configuration Management" starts with an explanation of the basics and builds the reader’s knowledge through step-by-step guidelines.<br /><br />The book concentrates on discussions related to realistic worked examples. Using this approach we discuss how to perform ad-hoc actions, script actions together to set up services, and how to script more complicated tasks. The discussion carries onto explanation of organising your configurations for large deployments and warps up with examples of how to extend the capabilities of Ansible.<br /><br />"Ansible Configuration Management" provides the knowledge you require to effectively manage your systems in a simple, quick, and maintainable way.</p>
Table of Contents (12 chapters)

Chapter 2. Simple Playbooks

Ansible is useful as a command-line tool for making small changes. However, its real power lies in its scripting abilities. While setting up machines, you almost always need to do more than one thing at a time. Ansible provides for this by using a tool called playbook. Using playbooks, you can perform many actions at once, and across multiple systems. They provide a way to orchestrate deployments, ensure a consistent configuration, or simply perform a common task.

Playbooks are expressed in YAML, and for the most part, Ansible uses a standard YAML parser. This means that you have all the features of YAML available to you as you write them. For example, you can use the same commenting system as you would in YAML. Many lines of a playbook can also be written and represented in YAML data types. See http://www.yaml.org/ for more information.

Playbooks also open up many opportunities. They allow you to carry the state from one command to the next. For example, you can...