mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Merge pull request #5697 from kormoc/fix_missing_localhost_group
Fix an issue where ansbile-pull fails with AttributeError
This commit is contained in:
@@ -272,6 +272,10 @@ class Inventory(object):
|
||||
new_host.set_variable("ansible_python_interpreter", sys.executable)
|
||||
new_host.set_variable("ansible_connection", "local")
|
||||
ungrouped = self.get_group("ungrouped")
|
||||
if ungrouped is None:
|
||||
self.add_group(Group('ungrouped'))
|
||||
ungrouped = self.get_group('ungrouped')
|
||||
|
||||
ungrouped.add_host(new_host)
|
||||
results.append(new_host)
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user