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)

New features in 1.3


There are two features in Ansible 1.3 that were alluded to previously in the chapter. The first feature is the metadata roles. They allow you to specify that your role depends on other roles. For example, if the application that you are deploying needs to send mail, your role could depend on a Postfix role. This would mean that before the application is set up and installed, Postfix will be installed and set up.

The meta/main.yml file would look similar to the following code:

---
allow_duplicates: no
dependencies:
  - apache

The allow_duplicates line is set to no, which is the default. If you set this to no, Ansible will not run a role the second time, if it is included twice with the same arguments. If you set it to yes, it will repeat the role even if it has run before. You can leave it off instead of setting it to no.

Dependencies are specified in the same format as roles. This means, you can pass variables here; either static values or variables that are passed to the...