An Ansible inventory file is a configuration file that defines the hosts and groups of hosts on which Ansible commands, modules, and tasks will operate. It specifies the machines that Ansible will manage, along with any necessary connection details.
The inventory file can be in various formats, such as:
-
INI format: A simple text format where hosts are listed under groups.
[local] localhost ansible_connection=local -
YAML format: A more structured format that can represent complex inventories.
all: hosts: localhost: ansible_connection: local
The inventory file allows you to organize your hosts, specify connection methods, and define variables for each host or group, making it essential for managing configurations and deployments with Ansible.
