make sure group_names is always sorted

this makes it consistent with previous ansilbe versions and other
paths that create the group_names variable
This commit is contained in:
Brian Coca 2016-03-04 13:12:35 -05:00
parent 27a33a6f18
commit d6546a7513

View file

@ -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()