Book Image

Ansible Quick Start Guide

By : Mohamed Alibi
Book Image

Ansible Quick Start Guide

By: Mohamed Alibi

Overview of this book

Configuration Management (CM) tools help administrators reduce their workload. Ansible is one of the best Configuration Management tools, and can act as an orchestrator for managing other CMs. This book is the easiest way to learn how to use Ansible as an orchestrator and a Configuration Management tool. With this book, you will learn how to control and monitor computer and network infrastructures of any size,physical or virtual. You will begin by learning about the Ansible client-server architecture. To get started, you will set up and configure an Ansible server. You will then go through the major features of Ansible: Playbook and Inventory. Then, we will look at Ansible systems and network modules. You will then use Ansible to enable infrastructure automated configuration management, followed by best practices for using Ansible roles and community modules. Finally, you will explore Ansible features such as Ansible Vault, Ansible Containers, and Ansible plugins.
Table of Contents (15 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Ansible: simple, lightweight, and powerful


Ansible is a leading orchestration platform that allows for automation, host configuration management, and the deployment of applications and virtual machines. Ansible can automate a range of IT infrastructure features, from simple, daily, and repetitive tasks to machine provisioning or the continuous integration and deployment of DevOps applications. It is very flexible and can cover bare-metal machines, virtual machines and platforms, and public or private cloud environments. Ansible can also manage network devices from switches, routers, and firewalls. It can also cover the setup of applications, the configuration and behavior of database management systems, package managers, and simple user applications:

Ansible logo

Note

If this is your first book about configuration management and you are looking for an easy and simple method to follow, you are in the right place.

One command is enough to install Ansible on Linux using the system's package manager from the distribution repository. Another way is to use Python's PyPI package manager for a faster and simpler installation. After that, it can simply be used in a similar way to execute any command. We would recommend going an extra step for a more complex or larger environment by editing the Ansible configuration file, so that it reads /etc/ansible/ansible.conf, filling in the inventory, and adding some group variables. Ansible does not require an agent installation on the client, but with a few extra steps, the connection can be made more secure. Ansible uses YAML, a simple configuration management language for Ansible playbooks, which is a human-readable coding language, so scripts can be written without much difficulty. When sending commands for specific tasks, the Ansible server translates the YAML code to the actual configuration code to the clients for immediate execution.

Note

For most of the tutorials in this book, Debian-based systems will be used for the servers and Linux clients. The location and package names of the configuration files may vary between distributions.

The Ansible host server is the only machine where recommended computing resources are to be met in order to run the engine correctly. As it is agentless, the clients only receive tasks in the form of commands that get executed on the system directly. Some Ansible modules may consume a fair amount of the network traffic by sending data from one machine to another. This is the lowest amount of traffic required to carry out a task, since Ansible only uses a tiny portion of traffic to submit the command to the hosts.

The rapid growth of Ansible has made it a very powerful tool. It is now considered the leading automation engine in the market. With its huge community support (Ansible Galaxy and GitHub projects) and Red Hat's proprietary management add-ons (Ansible Tower), its users have a wide variety of roles, modules, and add-ons to choose from that can automate every conceivable IT task.

Ansible offers its users the following features:

  • Systems configuration management
  • Agile application deployment following the best DevOps practices
  • Simplified orchestration and automation
  • Zero-downtime, continuous deployment
  • Support for cloud-native applications
  • Simple and optimized container adoption
  • Embedded security and compliance policy in automated tasks
  • Streamlined host provisioning
  • Support for multi-tier deployment
  • Support for heterogenic IT infrastructures
  • Support for multi-layered computer architecture
  • Support for infrastructure-as-a-service (IaaS) deployment
  • Support for platform-as-a-service (PaaS) deployment
  • Support for scalability for a fast-growing environment
  • Support for push and pull models for task execution
  • Fast host fact-sharing between servers for better redundancy and performance
  • Configuration for a variety of network devices
  • Management and monitoring of storage devices
  • Control of database management systems

Note

The Ansible module updates that come with each new release are a very good indication of the technologies and features that are officially supported. The modules allow the user to write simpler playbooks to perform more complex tasks.