W3cubDocs

/Ansible 2.9

script – Executes an inventory script that returns JSON

New in version 2.4.

Synopsis

  • The source provided must be 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.

Parameters

Parameter Choices/Defaults Configuration Comments
always_show_stderr
boolean
added in 2.5.1
Default:
"yes"
ini entries:

[inventory_plugin_script]
always_show_stderr = yes

env:ANSIBLE_INVENTORY_PLUGIN_SCRIPT_STDERR
Toggle display of stderr even when script was successful
cache
boolean
Default:
"no"
ini entries:

[inventory_plugin_script]
cache = no

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

Notes

Note

  • Whitelisted in configuration by default.

Status

Authors

  • UNKNOWN

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/plugins/inventory/script.html