Merge pull request #5697 from kormoc/fix_missing_localhost_group
Fix an issue where ansbile-pull fails with AttributeError
This commit is contained in:
commit
13f5ec3698
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue