summaryrefslogtreecommitdiff
path: root/lib/ansible/inventory/host.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/inventory/host.py')
-rw-r--r--lib/ansible/inventory/host.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py
index 268eef2f46..a48fbce6ff 100644
--- a/lib/ansible/inventory/host.py
+++ b/lib/ansible/inventory/host.py
@@ -138,6 +138,6 @@ class Host:
def get_group_vars(self):
results = {}
groups = self.get_groups()
- for group in sorted(groups, key=lambda g: g.depth):
+ for group in sorted(groups, key=lambda g: (g.depth, g.name)):
results = combine_vars(results, group.get_vars())
return results