An Ansible inventory is a collection of hosts and their associated variables used by Ansible to define the environment in which it will be running. It is usually stored as a text file with a list of hosts and their associated variables.

Example:

[web]
host1.example.com ip=192.168.1.1
host2.example.com ip=192.168.1.2

[db]
host3.example.com ip=192.168.1.3
host4.example.com ip=192.168.1.4

Leave a Reply

Your email address will not be published. Required fields are marked *