ebook img

Learning Ansible 2, 2nd Edition PDF

270 Pages·2016·11.06 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Learning Ansible 2, 2nd Edition

Learning Ansible 2 Second Edition Table of Contents Learning Ansible 2 Second Edition Credits About the Author About the Reviewer www.PacktPub.com Why subscribe? Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Errata Piracy Questions 1. Getting Started with Ansible IT automation The history of IT automation Advantages of IT automation Disadvantages of IT automation Limiting the possible damages of an error propagation Types of IT automation Agent-based systems Agent-less systems Agent-based versus Agent-less systems What is Ansible? Secure Shell (SSH) Why Ansible? Installing Ansible Installing Ansible using the system's package manager Installing via Yum Installing via Apt Installing via Homebrew Installing via pip Installing Ansible from source Creating a test environment with QEMU and KVM Version control system Using Ansible with Git Summary 2. Automating Simple Tasks YAML Hello Ansible Working with playbooks Studying the anatomy of a playbook Running a playbook Ansible verbosity Variables in playbooks Creating the Ansible user Configuring a basic server Enabling EPEL Installing Python bindings for SELinux Upgrading all installed packages Ensuring that NTP is installed, configured, and running Ensuring that FirewallD is present and enabled Adding a customized MOTD Changing the hostname Reviewing and running the playbook Installing and configuring a web server Publishing a website Jinja2 templates Variables Filters Conditionals Cycles Summary 3. Scaling to Multiple Hosts Working with inventory files The basic inventory file Groups in an inventory file Regular expressions in the inventory file Working with variables Host variables Group variables Variable files Overriding configuration parameters with an inventory file Working with dynamic inventory Amazon Web Services DigitalOcean Working with iterates in Ansible Standard iteration - with_items Nested loops - with_nested Fileglobs loop - with_fileglobs Integer loop - with_sequence Summary 4. Handling Complex Deployment Working with the local_action feature Delegating a task Working with conditionals Boolean conditionals Checking if a variable is set Working with include Working with handlers Working with roles Project organization Anatomy of a role Transforming your playbooks in a full Ansible project Transforming a playbook into a role Helper files Transforming the webserver role Handlers in roles Execution strategies Tasks blocks The Ansible template - Jinja filters Formatting data using filters Using filters with conditionals Defaulting undefined variables Security management Using Ansible vault Vaults and playbooks Encrypting user passwords Hiding passwords Using no_log Summary 5. Going Cloud Provisioning resources in the cloud Amazon Web Service AWS global infrastructure AWS Simple Storage Service AWS Elastic Compute Cloud (EC2) AWS Virtual Private Cloud (VPC) AWS Route 53 AWS Elastic Block Storage (EBS) AWS Identity and Access Management Amazon relational database service Setting up an account with AWS Simple AWS deployment Complex AWS deployment DigitalOcean Droplets SSH key management Private networking Adding an SSH key in DigitalOcean Deployment in DigitalOcean Summary 6. Getting Notifications from Ansible E-mails XMPP Slack Rocket Chat Internet Relay Chat (IRC) Amazon Simple Notification Service Nagios Summary 7. Creating a Custom Module Using Python modules Working with exit_json and fail_json Testing Python modules Using bash modules Using Ruby modules Testing modules Summary 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 9. Complex Environments Code based on the Git branch A single stable branch with multiple folders Software distribution strategy Copying files from the local machine Revision control system with branches Revision control system with tags RPM packages Preparing the environment Deploying a web app with revision control systems Deploying a web app with RPM packages Creating a Spec file Building RPMs manually Building RPMs with Ansible Building RPMs with CI/CD pipelines Building compiled software with RPM packaging Deployment strategies Canary deployment Blue/Green deployment Optimizations Pipelining Optimizing with_items Understanding what happens when your tasks are executed Summary 10. Introducing Ansible for Enterprises Ansible on Windows Ansible for networking devices Ansible Galaxy Ansible Tower Summary Learning Ansible 2 Second Edition Learning Ansible 2 Second Edition Copyright © 2016 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: November 2014 Second edition: November 2016 Production reference: 1161116 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78646-423-1 www.packtpub.com Credits Authors Copy Editor Fabio Alessandro Locati Madhusudan Uchil Reviewers Project Coordinator Tim Rupp Judie Jose Commissioning Editor Proofreader Pratik Shah Safis Editing Acquisition Editor Indexer Divya Poojari Pratik Shirodkar Content Development Editor Graphics Amedh Gemraram Pohad Kirk D'Penha Technical Editor Production Coordinator Vishal Kamal Mewada Shantanu N. Zagade

Description:
Ansible is an open source automation platform that assists organizations with tasks such as configuration management, application deployment, orchestration, and task automation. Basically complex tasks can be handled by the easy-to-use Ansible. This update to Learning Ansible is based on the latest
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.