Ansible Configuration Management - Second Edition

Book Description

Leverage the power of Ansible to manage your infrastructure efficiently

In Detail

Ansible is an open source software platform for configuring and managing computers. It provides a clear and concise way to manage the configuration of your Linux infrastructure. This book is a step-by-step guide that provides you with the knowledge you require to effectively manage your systems in a simple, quick, and maintainable way, with real-world examples.

You will begin by learning the basics of Ansible and then move on to exploring more advanced topics. You will then learn the basic and complex operations of playbooks and interact with modules to manage Windows machines and deploy them. You will also get acquainted with Ansible's more advanced features such as serially updating machines, delegating tasks to other machines, advanced uses of variables, looping and conditions, copying whole directories, and using filters to process variables. Towards the end of the book, you will learn how to increase the functionality of Ansible itself by writing your own modules and plugins.

What You Will Learn

  • Manage your Windows machines with Ansible
  • Use Ansible's command-line tools to interrogate systems
  • Interact with modules and deploy cloud infrastructures
  • Process data inside Ansible and extend the functionality of Ansible
  • Learn how to store secrets in Ansible's vault and discover other source code management techniques
  • Build maintainable configurations for large environments
  • Write custom Ansible plugins efficiently
  • Extend the functionality of Ansible by writing your own modules

Table of Contents

  1. Ansible Configuration Management Second Edition
    1. Table of Contents
    2. Ansible Configuration Management Second Edition
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Getting Started with Ansible
      1. Hardware and software required
      2. Installation methods
        1. Installing from your distribution
        2. Installing from pip
        3. Installing from the source code
      3. Setting up Ansible
        1. Setting it up on Windows
      4. First steps with Ansible
      5. Module help
      6. Summary
    9. 2. Simple Playbooks
      1. The target section
      2. The variable section
      3. The task section
      4. The handlers section
      5. The playbook modules
        1. The template module
        2. The set_fact module
        3. The pause module
        4. The wait_for module
        5. The assemble module
        6. The add_host module
        7. The group_by module
        8. The slurp module
      6. Windows playbook modules
      7. Cloud Infrastructure modules
        1. The AWS modules
      8. Summary
    10. 3. Advanced Playbooks
      1. Running operations in parallel
      2. Looping
      3. Conditional execution
      4. Task delegation
      5. Extra variables
        1. The hostvars variable
        2. The groups variable
        3. The group_names variable
        4. The inventory_hostname variable
        5. The inventory_hostname_short variable
        6. The inventory_dir variable
        7. The inventory_file variable
      6. Finding files with variables
      7. Environment variables
      8. External data lookups
      9. Storing results
      10. Processing data
      11. Debugging playbooks
        1. The debug module
        2. The verbose mode
        3. The check mode
        4. The pause module
      12. Summary
    11. 4. Larger Projects
      1. Includes
        1. Task includes
        2. Handler includes
        3. Playbook includes
      2. Roles
      3. Role metadata
      4. Role defaults
      5. Speeding things up
        1. Provisioning
        2. Tags
        3. Ansible's pull mode
      6. Storing secrets
      7. Summary
    12. 5. Custom Modules
      1. Writing a module in Bash
      2. Using a custom module
      3. Writing modules in Python
      4. External inventories
      5. Extending Ansible
        1. Connection plugins
        2. Lookup plugins
        3. Filter plugins
        4. Callback plugins
      6. Summary
    13. Index

Product Information

  • Title: Ansible Configuration Management - Second Edition
  • Author(s): Daniel Hall
  • Release date: April 2015
  • Publisher(s): Packt Publishing
  • ISBN: 9781785282300