Learning Ansible 2 - Second Edition

Learn everything you need to manage and handle your systems with ease with Ansible 2 using this comprehensive guide

Learning Ansible 2 - Second Edition

This ebook is included in a Mapt subscription
Fabio Alessandro Locati

Learn everything you need to manage and handle your systems with ease with Ansible 2 using this comprehensive guide
$0.00
$18.00
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786464231
Paperback266 pages

Book Description

Ansible is an open source automation platform that assists organizations with tasks such as configuration management, application deployment, orchestration, and task automation. With Ansible, even complex tasks can be handled easier than before.

In this book, you will learn about the fundamentals and practical aspects of Ansible 2 by diving deeply into topics such as installation (Linux, BSD, and Windows Support), playbooks, modules, various testing strategies, provisioning, deployment, and orchestration. In this book, you will get accustomed with the new features of Ansible 2 such as cleaner architecture, task blocks, playbook parsing, new execution strategy plugins, and modules. You will also learn how to integrate Ansible with cloud platforms such as AWS. The book ends with the enterprise versions of Ansible, Ansible Tower and Ansible Galaxy, where you will learn to interact Ansible with different OSes to speed up your work to previously unseen levels

By the end of the book, you’ll able to leverage the Ansible parameters to create expeditious tasks for your organization by implementing the Ansible 2 techniques and paradigms.

Table of Contents

Chapter 1: Getting Started with Ansible
IT automation
What is Ansible?
Secure Shell (SSH)
Why Ansible?
Installing Ansible
Creating a test environment with QEMU and KVM
Version control system
Using Ansible with Git
Summary
Chapter 2: Automating Simple Tasks
YAML
Hello Ansible
Working with playbooks
Ansible verbosity
Variables in playbooks
Creating the Ansible user
Configuring a basic server
Installing and configuring a web server
Publishing a website
Jinja2 templates
Summary
Chapter 3: Scaling to Multiple Hosts
Working with inventory files
Working with variables
Working with dynamic inventory
Working with iterates in Ansible
Summary
Chapter 4: Handling Complex Deployment
Working with the local_action feature
Delegating a task
Working with conditionals
Working with include
Working with handlers
Working with roles
Execution strategies
Tasks blocks
The Ansible template - Jinja filters
Security management
Summary
Chapter 5: Going Cloud
Provisioning resources in the cloud
Amazon Web Service
DigitalOcean
Summary
Chapter 6: Getting Notifications from Ansible
E-mails
XMPP
Slack
Rocket Chat
Internet Relay Chat (IRC)
Amazon Simple Notification Service
Nagios
Summary
Chapter 7: Creating a Custom Module
Using Python modules
Using bash modules
Using Ruby modules
Testing modules
Summary
Chapter 8: Debugging and Error Handling
The check mode
Indicating differences between files using --diff
Functional testing in Ansible
Functional testing using assert
Testing with tags
The --skip-tags
Managing exceptions
Trigger failure
Summary
Chapter 9: Complex Environments
Code based on the Git branch
A single stable branch with multiple folders
Software distribution strategy
Preparing the environment
Deploying a web app with revision control systems
Deploying a web app with RPM packages
Building compiled software with RPM packaging
Deployment strategies
Optimizations
Summary
Chapter 10: Introducing Ansible for Enterprises
Ansible on Windows
Ansible for networking devices
Ansible Galaxy
Ansible Tower
Summary

What You Will Learn

  • Set up Ansible 2 and an Ansible 2 project in a future-proof way
  • Perform basic operations with Ansible 2 such as creating, copying, moving, changing, and deleting files, and creating and deleting users)
  • Deploy complete cloud environments using Ansible 2 on AWS and DigitalOcean
  • Explore complex operations with Ansible 2 (Ansible vault, e-mails, and Nagios)
  • Develop and test Ansible playbooks
  • Write a custom module and test it

Authors

Table of Contents

Chapter 1: Getting Started with Ansible
IT automation
What is Ansible?
Secure Shell (SSH)
Why Ansible?
Installing Ansible
Creating a test environment with QEMU and KVM
Version control system
Using Ansible with Git
Summary
Chapter 2: Automating Simple Tasks
YAML
Hello Ansible
Working with playbooks
Ansible verbosity
Variables in playbooks
Creating the Ansible user
Configuring a basic server
Installing and configuring a web server
Publishing a website
Jinja2 templates
Summary
Chapter 3: Scaling to Multiple Hosts
Working with inventory files
Working with variables
Working with dynamic inventory
Working with iterates in Ansible
Summary
Chapter 4: Handling Complex Deployment
Working with the local_action feature
Delegating a task
Working with conditionals
Working with include
Working with handlers
Working with roles
Execution strategies
Tasks blocks
The Ansible template - Jinja filters
Security management
Summary
Chapter 5: Going Cloud
Provisioning resources in the cloud
Amazon Web Service
DigitalOcean
Summary
Chapter 6: Getting Notifications from Ansible
E-mails
XMPP
Slack
Rocket Chat
Internet Relay Chat (IRC)
Amazon Simple Notification Service
Nagios
Summary
Chapter 7: Creating a Custom Module
Using Python modules
Using bash modules
Using Ruby modules
Testing modules
Summary
Chapter 8: Debugging and Error Handling
The check mode
Indicating differences between files using --diff
Functional testing in Ansible
Functional testing using assert
Testing with tags
The --skip-tags
Managing exceptions
Trigger failure
Summary
Chapter 9: Complex Environments
Code based on the Git branch
A single stable branch with multiple folders
Software distribution strategy
Preparing the environment
Deploying a web app with revision control systems
Deploying a web app with RPM packages
Building compiled software with RPM packaging
Deployment strategies
Optimizations
Summary
Chapter 10: Introducing Ansible for Enterprises
Ansible on Windows
Ansible for networking devices
Ansible Galaxy
Ansible Tower
Summary

Book Details

ISBN 139781786464231
Paperback266 pages
Read More

Read More Reviews