Documentation

script - Executes an inventory script that returns JSON

New in version 2.4.

Synopsis

  • The source provided must an executable that returns Ansible inventory JSON
  • The source must accept --list and --host <hostname> as arguments. --host will only be used if no _meta key is present. This is a performance optimization as the script would be called per host otherwise.

Options

parameter
required
default
choices
configuration
comments
cache
no
ini entries:

[inventory_plugin_script ]
cache = False

env:ANSIBLE_INVENTORY_PLUGIN_SCRIPT_CACHE
Toggle the usage of the configured Cache plugin.

Notes

Note

  • It takes the place of the previously hardcoded script inventory.
  • To function it requires being whitelisted in configuration, which is true by default.

Author

  • UNKNOWN

If you want to help with development, please read Community Information & Contributing, Testing Ansible and Developing Plugins.