March 2019
Intermediate to advanced
412 pages
9h 49m
English
With this inventory script, when Ansible starts, it will execute the script once with --list to gather the group data. Then, Ansible will execute the script again with --host <hostname> for each host it discovered in the first call. With our script, this takes very little time, as there are very few hosts, and our execution is very fast. However, in an environment with a large number of hosts or a plugin that takes a while to run, gathering the inventory data can be a lengthy process. Fortunately, there is an optimization that can be made in the return data from a --list call that will prevent Ansible from rerunning the script for every host. The host-specific data can be returned all at once inside the group ...
Read now
Unlock full access