diff --git a/changelogs/fragments/49212-require-git-ansible-galaxy.yaml b/changelogs/fragments/49212-require-git-ansible-galaxy.yaml new file mode 100644 index 00000000000..62bf5058c86 --- /dev/null +++ b/changelogs/fragments/49212-require-git-ansible-galaxy.yaml @@ -0,0 +1,2 @@ +minor_changes: + - "ansible-galaxy: properly warn when git isn't found in an installed bin path instead of traceback" diff --git a/lib/ansible/playbook/role/requirement.py b/lib/ansible/playbook/role/requirement.py index 764d0c591f6..764b302281c 100644 --- a/lib/ansible/playbook/role/requirement.py +++ b/lib/ansible/playbook/role/requirement.py @@ -159,7 +159,7 @@ class RoleRequirement(RoleDefinition): raise AnsibleError("- scm %s is not currently supported" % scm) try: - scm_path = get_bin_path(scm) + scm_path = get_bin_path(scm, required=True) except (ValueError, OSError, IOError): raise AnsibleError("could not find/use %s, it is required to continue with installing %s" % (scm, src))