万本电子书0元读

万本电子书0元读

顶部广告

Mastering Ansible电子书

售       价:¥

11人正在读 | 0人评论 6.2

作       者:James Freeman

出  版  社:Packt Publishing

出版时间:2019-03-25

字       数:40.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Design, develop, and solve real-world automation and orchestration problems by unlocking the automation capabilities of Ansible. Key Features * Tackle complex automation challenges with the newly added features in Ansible 2.7 Book Description Automation is essential for success in the modern world of DevOps. Ansible provides a simple, yet powerful, automation engine for tackling complex automation challenges. This book will take you on a journey that will help you exploit the latest version's advanced features to help you increase efficiency and accomplish complex orchestrations. This book will help you understand how Ansible 2.7 works at a fundamental level and will also teach you to leverage its advanced capabilities. Throughout this book, you will learn how to encrypt Ansible content at rest and decrypt data at runtime. Next, this book will act as an ideal resource to help you master the advanced features and capabilities required to tackle complex automation challenges. Later, it will walk you through workflows, use cases, orchestrations, troubleshooting, and Ansible extensions. Lastly, you will examine and debug Ansible operations, helping you to understand and resolve issues. By the end of the book, you will be able to unlock the true power of the Ansible automation engine and tackle complex, real- world actions with ease. What you will learn * Gain an in-depth understanding of how Ansible works under the hood * Fully automate Ansible playbook executions with encrypted data * Access and manipulate variable data within playbooks * Use blocks to perform failure recovery or cleanup * Explore the Playbook debugger and the Ansible Console * Troubleshoot unexpected behavior effectively * Work with cloud infrastructure providers and container systems * Develop custom modules, plugins, and dynamic inventory sources Who this book is for This book is for Ansible developers and operators who have an understanding of its core elements and applications but are now looking to enhance their skills in applying automation using Ansible.
目录展开

Mastering Ansible Third Edition

Why subscribe?

Packt.com

Contributors

About the authors

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Code in Action

Conventions used

Get in touch

Reviews

Section 1: Ansible Overview and Fundamentals

The System Architecture and Design of Ansible

Technical requirements

Ansible version and configuration

Inventory parsing and data sources

Static inventory

Inventory ordering

Inventory variable data

Dynamic inventories

Runtime inventory additions

Inventory limiting

Playbook parsing

Order of operations

Relative path assumptions

Play behavior directives

Execution strategies

Host selection for plays and tasks

Play and task names

Module transport and execution

Module reference

Module arguments

Module blacklisting

Module transport and execution

Task performance

Variable types and location

Variable types

Magic variables

Accessing external data

Variable precedence

Precedence order

Variable group priority ordering

Merging hashes

Summary

Protecting Your Secrets with Ansible

Technical requirements

Encrypting data at rest

Vault IDs and passwords

Things Vault can encrypt

Creating new encrypted files

Password prompt

Password file

Password script

Encrypting existing files

Editing encrypted files

Password rotation on encrypted files

Decrypting encrypted files

Executing Ansible-playbook with encrypted files

Mixing encrypted data with plain YAML

Protecting secrets while operating

Secrets transmitted to remote hosts

Secrets logged to remote or local files

Summary

Ansible and Windows - Not Just for Linux

Technical requirements

Running Ansible from Windows

Checking your build

Enabling WSL

Installing Linux under WSL

Setting up Windows hosts for Ansible control

System requirements for automation with Ansible

Enabling the WinRM listener

Connecting Ansible to Windows

Handling Windows authentication and encryption

Authentication mechanisms

A note on accounts

Certificate validation

Automating Windows tasks with Ansible

Picking the right module

Installing software

Extending beyond modules

Summary

Infrastructure Management for Enterprises with AWX

Technical requirements

Getting AWX up and running

Integrating AWX with your first playbook

Defining a project

Defining an inventory

Defining credentials

Defining a template

Going beyond the basics

Role-based access control (RBAC)

Organizations

Scheduling

Auditing

Surveys

Workflow templates

Notifications

Summary

Section 2: Writing and Troubleshooting Ansible Playbooks

Unlocking the Power of Jinja2 Templates

Technical requirements

Control structures

Conditionals

Inline conditionals

Loops

Filtering loop items

Loop indexing

Macros

Macro variables

name

arguments

defaults

catch_kwargs

catch_varargs

caller

Data manipulation

Syntax

Useful built-in filters

default

count

random

round

Useful Ansible provided custom filters

Filters related to task status

shuffle

Filters dealing with path names

basename

dirname

expanduser

Base64 encoding

Searching for content

Omitting undefined arguments

Python object methods

String methods

List methods

int and float methods

Comparing values

Comparisons

Logic

Tests

Summary

Controlling Task Conditions

Technical requirements

Defining a failure

Ignoring errors

Defining an error condition

Defining a change

Special handling of the command family

Suppressing a change

Error recovery

Using the rescue section

Using the always section

Handling unreliable environments

Iterative tasks with loops

Summary

Composing Reusable Ansible Content with Roles

Technical requirements

Task, handler, variable, and playbook inclusion concepts

Including tasks

Passing variable values to included tasks

Passing complex data to included tasks

Conditional task includes

Tagging included tasks

Task includes with loops

Including handlers

Including variables

vars_files

Dynamic vars_files inclusion

include_vars

extra-vars

Including playbooks

Roles

Role structure

Tasks

Handlers

Variables

Modules and plugins

Dependencies

Files and templates

Putting it all together

Role dependencies

Role dependency variables

Tags

Role dependency conditionals

Role application

Mixing roles and tasks

Role includes and imports

Role sharing

Ansible Galaxy

Summary

Troubleshooting Ansible

Technical requirements

Playbook logging and verbosity

Verbosity

Logging

Variable introspection

Variable subelements

Subelements versus Python object method

Debugging code execution

Playbook debugging

Debugging local code

Debugging inventory code

Debugging playbook code

Debugging executor code

Debugging remote code

Debugging the action plugins

Summary

Extending Ansible

Technical requirements

Developing modules

The basic module construct

Custom modules

Example – Simple module

Documenting a module

Providing fact data

The check mode

Supporting check mode

Handling check mode

Developing plugins

Connection-type plugins

Shell plugins

Lookup plugins

Vars plugins

Fact-caching plugins

Filter plugins

Callback plugins

Action plugins

Distributing plugins

Developing dynamic inventory plugins

Listing hosts

Listing host variables

Simple inventory plugin

Optimizing script performance

Contributing to the Ansible project

Contribution submissions

The Ansible repository

Executing tests

Unit tests

Integration tests

Code-style tests

Making a pull request

Summary

Section 3: Orchestration with Ansible

Minimizing Downtime with Rolling Deployments

Technical requirements

In-place upgrades

Expanding and contracting

Failing fast

The any_errors_fatal option

The max_fail_percentage option

Forcing handlers

Minimizing disruptions

Delaying a disruption

Running destructive tasks only once

Serializing single tasks

Summary

Infrastructure Provisioning

Technical requirements

Managing cloud infrastructures

Creating servers

Booting virtual servers

Adding to runtime inventory

Using OpenStack inventory sources

Managing a public cloud infrastructure

Interacting with Docker containers

Building images

Building containers without a Dockerfile

Docker inventory

Ansible Container

Using ansible-container init

Using ansible-container build

Using ansible-container run

Summary

Network Automation

Technical requirements

Ansible for network manage ment

Cross-platform support

Configuration portability

Backup, restore, and version control

Automated change requests

Handling multiple device types

Researching your modules

Configuring your modules

Writing your playbooks

Configuring Cumulus Networks switches with Ansible

Defining our inventory

Practical examples

Best practices

Inventory

Gathering facts

Jump hosts

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部