Book description
Among the many configuration management tools available, Ansible has some distinct advantages: It's minimal in nature. You don't need to install agents on your nodes. And there's an easy learning curve. With this updated third edition, you'll quickly learn how to be productive with Ansible whether you're a developer deploying code or a system administrator looking for a better automation solution.
Authors Bas Meijer, Lorin Hochstein, and Rene Moser show you how to write playbooks (Ansible's configuration management scripts), manage remote servers, and explore the tool's real power: built-in declarative modules. You'll learn how Ansible has all the functionality you need--and the simplicity you desire.
- Explore Ansible configuration management and deployment
- Manage Linux, Windows, and network devices
- Learn how to apply Ansible best practices
- Understand how to use the new collections format
- Create custom modules and plug-ins
- Generate reusable Ansible content for open source middleware
- Build container images, images for cloud instances, and cloud infrastructure
- Automate CI/CD development environments
- Learn how to use Ansible Automation Platform for DevOps
Publisher resources
Table of contents
- Preface to the Third Edition
- 1. Introduction
- 2. Installation and Setup
- 3. Playbooks: A Beginning
-
4. Inventory: Describing Your Servers
- Inventory/Hosts Files
- Behavioral Inventory Parameters
- Groups and Groups and Groups
- Hosts and Group Variables: Inside the Inventory
- Host and Group Variables: In Their Own Files
- Dynamic Inventory
- Breaking the Inventory into Multiple Files
- Adding Entries at Runtime with add_host and group_by
- Conclusion
- 5. Variables and Facts
- 6. Introducing Mezzanine: Our Test Application
-
7. Deploying Mezzanine with Ansible
- Listing Tasks in a Playbook
- Organization of Deployed Files
- Variables and Secret Variables
- Installing Multiple Packages
- Adding the Become Clause to a Task
- Updating the apt Cache
- Checking Out the Project Using Git
- Installing Mezzanine and Other Packages into a Virtual Environment
- Complex Arguments in Tasks: A Brief Digression
- Configuring the Database
- Generating the local_settings.py File from a Template
- Running django-manage Commands
- Running Custom Python Scripts in the Context of the Application
- Enabling the NGINX Configuration
- Installing TLS Certificates
- Installing Twitter Cron Job
- The Full Playbook
- Running the Playbook Against a Vagrant Machine
- Troubleshooting
- Conclusion
- 8. Debugging Ansible Playbooks
- 9. Roles: Scaling Up Your Playbooks
- 10. Complex Playbooks
-
11. Customizing Hosts, Runs, and Handlers
- Patterns for Specifying Hosts
- Limiting Which Hosts Run
- Running a Task on the Control Machine
- Manually Gathering Facts
- Retrieving an IP Address from the Host
- Running on One Host at a Time
- Running on a Batch of Hosts at a Time
- Running Only Once
- Limiting Which Tasks Run
- Running Strategies
- Advanced Handlers
- Conclusion
- 12. Managing Windows Hosts
-
13. Ansible and Containers
- Kubernetes
- Docker Application Life Cycle
- Registries
- Ansible and Docker
- Connecting to the Docker Daemon
- Example Application: Ghost
- Running a Docker Container on Our Local Machine
- Building an Image from a Dockerfile
- Pushing Our Image to the Docker Registry
- Orchestrating Multiple Containers on Our Local Machine
- Querying Local Images
- Deploying the Dockerized Application
- Conclusion
- 14. Quality Assurance with Molecule
- 15. Collections
- 16. Creating Images
-
17. Cloud Infrastructure
- Terminology
- Specifying Credentials
- Prerequisite: Boto3 Python Library
- Dynamic Inventory
- Defining Dynamic Groups with Tags
- Virtual Private Clouds
- Configuring ansible.cfg for Use with ec2
- Launching New Instances
- EC2 Key Pairs
- Security Groups
- Getting the Latest AMI
- Create a New Instance and Add It to a Group
- Waiting for the Server to Come Up
- Putting It All Together
- Specifying a Virtual Private Cloud
- Conclusion
- 18. Callback Plug-ins
-
19. Custom Modules
- Example: Checking That You Can Reach a Remote Server
- Should You Develop a Module?
- Where to Put Your Custom Modules
- How Ansible Invokes Modules
- Expected Outputs
- Implementing Modules in Python
- Documenting Your Module
- Debugging Your Module
- Implementing the Module in Bash
- Specifying an Alternative Location for Bash
- Conclusion
- 20. Making Ansible Go Even Faster
- 21. Networking and Security
- 22. CI/CD and Ansible
- 23. Ansible Automation Platform
- 24. Best Practices
- Bibliography
- Index
- About the Authors
Product information
- Title: Ansible: Up and Running, 3rd Edition
- Author(s):
- Release date: July 2022
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098109158
You might also like
book
Kubernetes: Up and Running, 3rd Edition
This third edition comes with a dedicated playlist of interactive Katacoda labs mapped to each section …
book
Terraform: Up and Running, 3rd Edition
Terraform has become a key player in the DevOps world for defining, launching, and managing infrastructure …
video
Kubernetes for the Absolute Beginners - Hands-On
Starting from the fundamental concept of containers, the course gradually unfolds into a comprehensive guide on …
book
Docker: Up & Running, 3rd Edition
Docker and Linux containers have fundamentally changed the way that organizations develop, deliver, and run software …