mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Don't re-add galaxy deps if they've already been added for install
Fixes #8890
This commit is contained in:
@@ -780,7 +780,7 @@ def execute_install(args, options, parser):
|
|||||||
# we're done with the temp file, clean it up
|
# we're done with the temp file, clean it up
|
||||||
os.unlink(tmp_file)
|
os.unlink(tmp_file)
|
||||||
# install dependencies, if we want them
|
# install dependencies, if we want them
|
||||||
if not no_deps:
|
if not no_deps and installed:
|
||||||
if not role_data:
|
if not role_data:
|
||||||
role_data = get_role_metadata(role.get("name"), options)
|
role_data = get_role_metadata(role.get("name"), options)
|
||||||
role_dependencies = role_data['dependencies']
|
role_dependencies = role_data['dependencies']
|
||||||
@@ -792,12 +792,15 @@ def execute_install(args, options, parser):
|
|||||||
else:
|
else:
|
||||||
dep = ansible.utils.role_yaml_parse(dep)
|
dep = ansible.utils.role_yaml_parse(dep)
|
||||||
if not get_role_metadata(dep["name"], options):
|
if not get_role_metadata(dep["name"], options):
|
||||||
print '- adding dependency: %s' % dep["name"]
|
if dep not in roles_left:
|
||||||
roles_left.append(dep)
|
print '- adding dependency: %s' % dep["name"]
|
||||||
|
roles_left.append(dep)
|
||||||
|
else:
|
||||||
|
print '- dependency %s already pending installation.' % dep["name"]
|
||||||
else:
|
else:
|
||||||
print '- dependency %s is already installed, skipping.' % dep["name"]
|
print '- dependency %s is already installed, skipping.' % dep["name"]
|
||||||
if not tmp_file or not installed:
|
if not tmp_file or not installed:
|
||||||
if tmp_file:
|
if tmp_file and installed:
|
||||||
os.unlink(tmp_file)
|
os.unlink(tmp_file)
|
||||||
print "- %s was NOT installed successfully." % role.get("name")
|
print "- %s was NOT installed successfully." % role.get("name")
|
||||||
exit_without_ignore(options)
|
exit_without_ignore(options)
|
||||||
|
|||||||
Reference in New Issue
Block a user