a )g @sXddlmZmZmZeZdZdZddlm Z ddl m Z ddl m Z Gddde Zd S) )absolute_importdivisionprint_functiona[ name: auto author: - Matt Davis (@nitzmahone) version_added: "2.5" short_description: Loads and executes an inventory plugin specified in a YAML config description: - By enabling the C(auto) inventory plugin, any YAML inventory config file with a C(plugin) key at its root will automatically cause the named plugin to be loaded and executed with that config. This effectively provides automatic enabling of all installed/accessible inventory plugins. - To disable this behavior, remove C(auto) from the C(INVENTORY_ENABLED) config element. z # This plugin is not intended for direct use; it is a fallback mechanism for automatic enabling of # all installed inventory plugins. )AnsibleParserError)BaseInventoryPlugin)inventory_loadercs*eZdZdZfddZdddZZS)InventoryModuleautocs(|ds|dsdStt||S)Nz.ymlz.yamlF)endswithsuperr verify_file)selfpath __class__B/usr/lib/python3.9/site-packages/ansible/plugins/inventory/auto.pyr "szInventoryModule.verify_fileTcCs|j|dd}z|dd}Wnty4d}Yn0|sHtd|t|}|sftd||||std|||jd|j ||j ||||dz | WntyYn0dS)NF)cachepluginzRno root 'plugin' key found, '{0}' is not a valid YAML inventory plugin config filez5inventory config '{0}' specifies unknown plugin '{1}'zFinventory source '{0}' could not be verified by inventory plugin '{1}'z>Using inventory plugin '{0}' to process inventory source '{1}') Zload_from_filegetAttributeErrorrformatrr ZdisplayvZ _load_nameparseZupdate_cache_if_changed)r Z inventoryloaderrrZ config_dataZ plugin_namerrrrr's$      zInventoryModule.parse)T)__name__ __module__ __qualname__NAMEr r __classcell__rrrrrs rN)Z __future__rrrtypeZ __metaclass__Z DOCUMENTATIONZEXAMPLESZansible.errorsrZansible.plugins.inventoryrZansible.plugins.loaderrrrrrrs