Commit e0a15d0c by Steven Dossett

Updated to support inventory options from command line

parent 1ff93e6b
......@@ -34,12 +34,12 @@ class LookupModule(object):
def __init__(self, basedir=None, **kwargs):
self.basedir = basedir
self.host_list = kwargs['runner'].inventory.host_list
def run(self, terms, inject=None, **kwargs):
terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject)
if not isinstance(terms, list):
raise errors.AnsibleError("with_inventory_hostnames expects a list")
return flatten(inventory.Inventory().list_hosts(terms))
return flatten(inventory.Inventory(self.host_list).list_hosts(terms))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment