1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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