From 2a2e4721a45a0dc4f0a2d497973275a5ef73947d Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 5 Sep 2018 14:06:39 -0400 Subject: [PATCH] Pass path to GalaxyRole object (#43051) (#44583) This will list all roles in all paths in roles_path rather than just the first path in roles_path. (cherry picked from commit 05fff274156735d883b778cd5f943d9adde9a831) --- 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 00000000000..746bea9c7b0 --- /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 510f0c28f3d..cac05a70b18 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -488,7 +488,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