Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show host_vars/ also in --graph #56307

Merged
merged 5 commits into from Jun 14, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,2 @@
bugfixes:
- show host_vars in ansible-inventory's --graph option.
@@ -283,7 +283,7 @@ def _graph_group(self, group, depth=0):
if group.name != 'all':
for host in sorted(group.hosts, key=attrgetter('name')):
result.append(self._graph_name(host.name, depth))
result.extend(self._show_vars(host.get_vars(), depth + 1))
result.extend(self._show_vars(host._get_host_variables(), depth + 1))
This conversation was marked as resolved by bcoca

This comment has been minimized.

Copy link
@Akasurde

Akasurde May 10, 2019

Member

Do you think we should remove internal variable too.

                host_vars = self._get_host_variables(host)
                if host_vars:
                    self._remove_internal(host_vars)
                    result.extend(self._show_vars(host_vars, depth + 1))

This comment has been minimized.

Copy link
@bcoca

bcoca May 10, 2019

Author Member

good catch, that remove_internal is redundant, show_vars already does same, refactored it to always return clean vars


result.extend(self._show_vars(self._get_group_variables(group), depth))

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.