From 05fff274156735d883b778cd5f943d9adde9a831 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Thu, 23 Aug 2018 12:44:48 -0400 Subject: [PATCH] Pass path to GalaxyRole object (#43051) This will list all roles in all paths in roles_path rather than just the first path in roles_path. --- changelogs/fragments/galaxy_list_all_roles.yaml | 2 ++ lib/ansible/cli/galaxy.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/galaxy_list_all_roles.yaml diff --git a/changelogs/fragments/galaxy_list_all_roles.yaml b/changelogs/fragments/galaxy_list_all_roles.yaml new file mode 100644 index 0000000000..746bea9c7b --- /dev/null +++ b/changelogs/fragments/galaxy_list_all_roles.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-galaxy - properly list all roles in roles_path (https://github.com/ansible/ansible/issues/43010) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index fceb36eb38..afe912b2d8 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -493,7 +493,7 @@ class GalaxyCLI(CLI): path_files = os.listdir(role_path) path_found = True for path_file in path_files: - gr = GalaxyRole(self.galaxy, path_file) + gr = GalaxyRole(self.galaxy, path_file, path=path) if gr.metadata: install_info = gr.install_info version = None