mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Set the inventory on the variable manager for the adhoc cli usage (v2)
This commit is contained in:
@@ -93,6 +93,7 @@ class AdHocCLI(CLI):
|
|||||||
variable_manager = VariableManager()
|
variable_manager = VariableManager()
|
||||||
|
|
||||||
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=self.options.inventory)
|
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=self.options.inventory)
|
||||||
|
variable_manager.set_inventory(inventory)
|
||||||
|
|
||||||
hosts = inventory.list_hosts(pattern)
|
hosts = inventory.list_hosts(pattern)
|
||||||
if len(hosts) == 0:
|
if len(hosts) == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user