diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index c37f296388..cd8b44ec59 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -330,7 +330,7 @@ class VariableManager: variables['playbook_dir'] = loader.get_basedir() if host: - variables['group_names'] = [group.name for group in host.get_groups()] + variables['group_names'] = [group.name for group in host.get_groups() if group.name != 'all'] if self._inventory is not None: variables['groups'] = dict()