Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Title Page
Copyright
Mastering Ansible
Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
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
Downloading the color images of this book
Errata
Piracy
Questions
System Architecture and Design of Ansible
Ansible version and configuration
Inventory parsing and data sources
Static inventory
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 transport and execution
Task performance
Variable types and location
Variable types
Accessing external data
Variable precedence
Precedence order
Merging hashes
Summary
Protecting Your Secrets with Ansible
Encrypting data at rest
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
Protecting secrets while operating
Secrets transmitted to remote hosts
Secrets logged to remote or local files
Summary
Unlocking the Power of Jinja2 Templates
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
Defining a failure
Ignoring errors
Defining an error condition
Defining a change
Special handling of the command family
Suppressing a change
Error recovery
Rescue
Always
Summary
Composing Reusable Ansible Content with Roles
Task, handler, variable, and playbook include 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
Role sharing
Ansible Galaxy
Summary
Minimizing Downtime with Rolling Deployments
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
Troubleshooting Ansible
Playbook logging and verbosity
Verbosity
Logging
Variable introspection
Variable sub elements
Subelement 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
Developing modules
The basic module construct
Custom modules
Simple module
Module documentation
Providing fact data
The check mode
Supporting the check mode
Handling check mode
Developing plugins
Connection type plugins
Shell plugins
Lookup plugins
Vars plugins
The 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
Infrastructure Provisioning
Managing cloud infrastructure
Creating servers
Booting virtual servers
Adding to runtime inventory
Using OpenStack inventory source
Interacting with Docker containers
Building images
Building containers without a Dockerfile
Docker inventory
Previewing of Ansible container
Init
Build
Run
Summary
← Prev
Back
Next →
← Prev
Back
Next →