mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 10:43:14 +00:00
Remove duplicate host file reads by removing a legacy check.
This allows using a form such as
ansible -i <( arbitrary command ) all -m ping
This commit is contained in:
@@ -90,12 +90,8 @@ class Inventory(object):
|
||||
self.parser = InventoryScript(filename=host_list)
|
||||
self.groups = self.parser.groups.values()
|
||||
else:
|
||||
data = file(host_list).read()
|
||||
if not data.startswith("---"):
|
||||
self.parser = InventoryParser(filename=host_list)
|
||||
self.groups = self.parser.groups.values()
|
||||
else:
|
||||
raise errors.AnsibleError("YAML inventory support is deprecated in 0.6 and removed in 0.7, see the migration script in examples/scripts in the git checkout")
|
||||
self.parser = InventoryParser(filename=host_list)
|
||||
self.groups = self.parser.groups.values()
|
||||
|
||||
utils.plugins.vars_loader.add_directory(self.basedir(), with_subdir=True)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user