Red Hat Ansible is an open source configuration management tool that we use for automating tasks, deploying applications, and IT infrastructure orchestration. Using Ansible, you can automate everyday tasks like updating and patching systems, installing software, onboarding users, and provisioning infrastructure.
In this first article, we’ll cover basic terminology, why to choose Ansible, and how to install it. In an upcoming article, we’ll look at how to configure Ansible.
Basic Ansible terminology
Before diving into Ansible, let’s get familiar with Ansible terminology.
Node terminology
Important node-related terminology for Ansible includes control nodes, managed nodes, inventories, and hostfiles:
- Control node: Any host with Ansible installed. Ansible control nodes are primarily used to run tasks on managed hosts. You can use any machine with Python installed as an Ansible control node. However, you cannot use Windows as an Ansible control node.
- Managed nodes: Hosts that you manage using Ansible.
- Inventory: A list of managed nodes.
- Hostfile: An inventory file is often known as a hostfile. In it, you can specify your inventory using IPs or hostnames and can organize them into groups.
Modules
Modules are code blocks that Ansible executes to perform common tasks like adding users, copying files, and pinging managed hosts.
Tasks and playbooks
Tasks are actions that Ansible performs on a managed host. You can perform a single task using ad-hoc commands.
Ansible playbooks are lists of repeatable tasks written in YAML Ain’t Markup Language (YAML), which makes them easy to read, write, and share.
Why Ansible?
When choosing a new tool, you’ll always have this question: "Why should I consider using this tool over others?" There are several reasons why you should use Ansible as your configuration management and infrastructure orchestration tool. Here are some of them.
Ansible is agentless
Unlike Chef and Puppet, Ansible is agentless, meaning that you don’t have to worry about installing or configuring any packages on your managed nodes. Since Ansible doesn’t install any software or run daemons on a managed node, there is no question on how to upgrade Ansible. This fact eliminates a lot of admin overhead and lets you start using Ansible in few hours, saving you time to work on playbooks.
Ansible uses SSH for communication
Ansible, by default, uses the SSH protocol for communication between control nodes and managed nodes. Ansible can then communicate securely with its managed nodes using SFTP for secure file transfers.
Ansible uses parallelism (forks)
Ansible communicates in parallel with its managed nodes, allowing it to run automated tasks much faster. By default, the forks
value is five, but this value can be altered in the configuration file.
Installing Ansible
To keep things simple in this series, I’ve created one control node named RHEL8
and four managed nodes (node1
, node2
, node3
, and node4
) all running Red Hat Enterprise Linux.
Ansible can be installed on any machine, but there are requirements for the control node. Control nodes should have Python 2 (2.7) or Python 3 (3.5 or higher) installed. Windows control nodes are not supported.
You can install Ansible from source code, the Python package manager (PIP), or your distro’s package manager. The recommended method for installing Ansible is from the distro’s package manager, so here we install Ansible on a Red Hat machine from its package manager, on our control node named RHEL8
:
[kc@RHEL8 ~]$ sudo yum install ansible -y
or:
[kc@RHEL8 ~]$ sudo dnf install ansible -y
Now, check the installed version of Ansible:
[kc@RHEL8 ~]$ ansible --version
ansible 2.8.5
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/kc/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Jun 12 2019, 01:12:31) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]
Check back soon for another article to learn how to configure your new installation.
Sobre o autor
Keerthi is aspiring Cloud, DevOps engineer, he has been working with Windows and Linux systems. He believes in continuous learning (CL) and continuous sharing (CS), on his way building his very own CL CS pipeline. When he is not playing in the CLI, you will find him playing Cricket.
Navegue por canal
Automação
Últimas novidades em automação de TI para empresas de tecnologia, equipes e ambientes
Inteligência artificial
Descubra as atualizações nas plataformas que proporcionam aos clientes executar suas cargas de trabalho de IA em qualquer ambiente
Nuvem híbrida aberta
Veja como construímos um futuro mais flexível com a nuvem híbrida
Segurança
Veja as últimas novidades sobre como reduzimos riscos em ambientes e tecnologias
Edge computing
Saiba quais são as atualizações nas plataformas que simplificam as operações na borda
Infraestrutura
Saiba o que há de mais recente na plataforma Linux empresarial líder mundial
Aplicações
Conheça nossas soluções desenvolvidas para ajudar você a superar os desafios mais complexos de aplicações
Programas originais
Veja as histórias divertidas de criadores e líderes em tecnologia empresarial
Produtos
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Red Hat Cloud Services
- Veja todos os produtos
Ferramentas
- Treinamento e certificação
- Minha conta
- Suporte ao cliente
- Recursos para desenvolvedores
- Encontre um parceiro
- Red Hat Ecosystem Catalog
- Calculadora de valor Red Hat
- Documentação
Experimente, compre, venda
Comunicação
- Contate o setor de vendas
- Fale com o Atendimento ao Cliente
- Contate o setor de treinamento
- Redes sociais
Sobre a Red Hat
A Red Hat é a líder mundial em soluções empresariais open source como Linux, nuvem, containers e Kubernetes. Fornecemos soluções robustas que facilitam o trabalho em diversas plataformas e ambientes, do datacenter principal até a borda da rede.
Selecione um idioma
Red Hat legal and privacy links
- Sobre a Red Hat
- Oportunidades de emprego
- Eventos
- Escritórios
- Fale com a Red Hat
- Blog da Red Hat
- Diversidade, equidade e inclusão
- Cool Stuff Store
- Red Hat Summit