更新时间:2021-06-24 16:07:21
封面
Title Page
Copyright and Credits
Practical Ansible 2
About Packt
Why subscribe?
Contributors
About the authors
About the reviewers
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
Conventions used
Get in touch
Reviews
Section 1: Learning the Fundamentals of Ansible
Getting Started with Ansible
Technical requirements
Installing and configuring Ansible
Installing Ansible on Linux and FreeBSD
Installing Ansible on macOS
Configuring Windows hosts for Ansible
Understanding your Ansible installation
Understanding how Ansible connects to hosts
Verifying the Ansible installation
Managed node requirements
Running from source versus pre-built RPMs
Summary
Questions
Further reading
Understanding the Fundamentals of Ansible
Getting familiar with the Ansible framework
Breaking down the Ansible components
Learning the YAML syntax
Organizing your automation code
Exploring the configuration file
Command-line arguments
Understanding ad hoc commands
Defining variables
Understanding Jinja2 filters
Defining Your Inventory
Creating an inventory file and adding hosts
Using host groups
Adding host and group variables to your inventory
Generating a dynamic inventory file
Using multiple inventory sources in the inventory directories
Using static groups with dynamic groups
Special host management using patterns
Playbooks and Roles
Understanding the playbook framework
Comparing playbooks and ad hoc tasks
Defining plays and tasks
Understanding roles – the playbook organizer
Setting up role-based variables and dependencies
Ansible Galaxy
Using conditions in your code
Repeating tasks with loops
Grouping tasks using blocks
Configuring play execution via strategies
Using ansible-pull
Section 2: Expanding the Capabilities of Ansible
Consuming and Creating Modules
Executing multiple modules using the command line
Reviewing the module index
Accessing module documentation from the command line
Module return values
Developing custom modules
Avoiding common pitfalls
Testing and documenting your module
The module checklist
Contributing upstream – submitting a GitHub pull request
Consuming and Creating Plugins
Discovering the plugin types
Finding included plugins
Creating custom plugins
Learning to integrate custom plugins with Ansible source code
Sharing plugins with the community