0Pricing
Ansible Academy · Lesson

Host & Group Variables in the Inventory

Attach connection and config vars to hosts.

Variables Live With Hosts

Inventories hold more than names. You can attach variables to a host or group so tasks adapt per machine.

Host Variables in INI

In INI, write key=value pairs right after a host on the same line. These apply only to that one host.

web1.example.com http_port=8080

All lessons in this course

  1. INI vs YAML Inventory Files
  2. Grouping Hosts: web, db & app
  3. Nested Groups & the children Keyword
  4. Host & Group Variables in the Inventory
← Back to Ansible Academy