# Ansible Inventory

In 
Published 2022-12-03

This tutorial explains to you how to create and use a simple Ansible inventory.

One time Ansible installation is done, you must define the target machines. This is done using the Ansible inventory file.

This is an ordinary text file which contains all the targets. Each target machine is defined on one row.

Here is an example on the image below:

In this case the password in not encrypted, but in production this must be done.

You can group the host using a label as in image below:

Now you can test that Ansible can send a command to a target machine:

ansible target1 -m ping -i inventory.txt

The same command can be run against the Ansible target machines group:

Now you can define and use Ansible playbooks.