From d6546a75134c0498e6c46372d20a297f64356a20 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 4 Mar 2016 13:12:35 -0500 Subject: [PATCH] make sure group_names is always sorted this makes it consistent with previous ansilbe versions and other paths that create the group_names variable --- lib/ansible/vars/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 9cb0108ed6..1405d8736d 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -362,7 +362,7 @@ class VariableManager: variables['playbook_dir'] = loader.get_basedir() if host: - variables['group_names'] = [group.name for group in host.get_groups() if group.name != 'all'] + variables['group_names'] = sorted([group.name for group in host.get_groups() if group.name != 'all']) if self._inventory is not None: variables['groups'] = dict()