Pcornel
Automation · Inventory

Hosts

Cheat sheet · https://pcornel.dk/topic.php?topic=5842

Back to the Topic

Answer

Hosts in an inventory are individual managed systems, each with a name, connection address and host variables such as platform, credentials reference or role.

Remember

  • Each host has a name and connection address.
  • Host variables override group variables.
  • Names must be unique.

First checks

  • ansible-inventory --host <h> — host vars
  • ansible_host/ansible_network_os set — connection
  • Hostname conventions — consistency

Verify in this order

host entry → connection vars → target

Where it usually breaks

Inventory/vars → play/task selection → connection/become → module request → module result → target object read-back → handler/service effective state → workload verification.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5842

Confirmation

Confirm action

Continue?