RSS 피드 구독하기

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.


저자 소개

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. 

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래