mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Inject existing groups at InventoryDir initialization
This fixes a corner case where ini files live in a subdir of the main inventory directory. Reproducing the original error: mkdir -p inventory/ini cat > inventory/ini/hosts << EOF [www] www1 EOF $ ansible -i inventory/ all -m ping ERROR! 'all' (or without the [www] group, it would complain about 'ungrouped')
This commit is contained in:
parent
f42f5e6740
commit
7461ba9998
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ class InventoryDirectory(object):
|
|||
continue
|
||||
fullpath = os.path.join(self.directory, i)
|
||||
if os.path.isdir(fullpath):
|
||||
parser = InventoryDirectory(loader=loader, filename=fullpath)
|
||||
parser = InventoryDirectory(loader=loader, groups=groups, filename=fullpath)
|
||||
else:
|
||||
parser = get_file_parser(fullpath, self.groups, loader)
|
||||
if parser is None:
|
||||
|
|
Loading…
Reference in a new issue