mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
Reimplement the class method on Runner.
This commit is contained in:
parent
195e6d617b
commit
746f1b92ae
2 changed files with 36 additions and 1 deletions
|
@ -123,6 +123,17 @@ class Runner(object):
|
|||
self._tmp_paths = {}
|
||||
random.seed()
|
||||
|
||||
# *****************************************************
|
||||
|
||||
@classmethod
|
||||
def parse_hosts(cls, host_list, override_hosts=None, extra_vars=None):
|
||||
''' parse the host inventory file, returns (hosts, groups) '''
|
||||
if override_hosts is None:
|
||||
inventory = ansible.inventory.Inventory(host_list, extra_vars)
|
||||
else:
|
||||
inventory = ansible.inventory.Inventory(override_hosts)
|
||||
|
||||
return inventory.host_list, inventory.groups
|
||||
|
||||
# *****************************************************
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue