更新时间:2021-06-24 15:09:17
coverpage
Title Page
Copyright and Credits
Learning Ansible 2.7 Third Edition
About Packt
Why subscribe?
Packt.com
Contributors
About the author
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
Conventions used
Get in touch
Reviews
Section 1: Creating a Web Server Using Ansible
Getting Started with Ansible
Technical requirements
IT automation
Advantages of IT automation
Disadvantages of IT automation
Types of IT automation
Agent-based systems
Agent-less systems
Agent-based versus agent-less systems
What is Ansible?
Secure Shell
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 Vagrant
Version control systems
Using Ansible with Git
Summary
Automating Simple Tasks
Technical Requirement
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
Section 2: Deploying Playbooks in a Production Environment
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 inventories
Amazon Web Services
DigitalOcean
Working with iterates in Ansible
Using standard iteration – with_items
Using nested loops – with_nested
Fileglobs loop – with_fileglobs
Using an integer loop – with_sequence
Handling Complex Deployment
Working with the local_action feature
Delegating a task
Working with conditionals
Boolean conditionals
Checking whether a variable is set
Working with include
Working with handlers