Debugging inventory code
Inventory code deals with finding inventory sources, reading or executing the discovered files, parsing the inventory data into inventory objects, and loading variable data for the inventory. To debug how Ansible will deal with an inventory, a breakpoint must be added inside inventory/__init__.py or one of the other files within the inventory/ subdirectory. This directory will be located on the local filesystem wherever Ansible has been installed. On a Linux system, this is typically stored in the /usr/lib/python2.7/site-packages/ansible/inventory/ path. This path may be inside a Python virtual environment if Ansible has been installed that way. To discover where Ansible is installed, simply type which ansible from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access