mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
added some debug to galaxy
This commit is contained in:
parent
29bc8f51d7
commit
17f659a143
1 changed files with 23 additions and 21 deletions
|
@ -320,6 +320,7 @@ class GalaxyCLI(CLI):
|
||||||
roles_done = []
|
roles_done = []
|
||||||
roles_left = []
|
roles_left = []
|
||||||
if role_file:
|
if role_file:
|
||||||
|
self.display.debug('Getting roles from %s' % role_file)
|
||||||
try:
|
try:
|
||||||
f = open(role_file, 'r')
|
f = open(role_file, 'r')
|
||||||
if role_file.endswith('.yaml') or role_file.endswith('.yml'):
|
if role_file.endswith('.yaml') or role_file.endswith('.yml'):
|
||||||
|
@ -350,6 +351,8 @@ class GalaxyCLI(CLI):
|
||||||
role = roles_left.pop(0)
|
role = roles_left.pop(0)
|
||||||
role_path = role.path
|
role_path = role.path
|
||||||
|
|
||||||
|
self.display.debug('Installing role %s' % role_path)
|
||||||
|
|
||||||
if role_path:
|
if role_path:
|
||||||
self.options.roles_path = role_path
|
self.options.roles_path = role_path
|
||||||
else:
|
else:
|
||||||
|
@ -400,27 +403,26 @@ class GalaxyCLI(CLI):
|
||||||
if tmp_file != role.src:
|
if tmp_file != role.src:
|
||||||
os.unlink(tmp_file)
|
os.unlink(tmp_file)
|
||||||
# install dependencies, if we want them
|
# install dependencies, if we want them
|
||||||
|
if not no_deps and installed:
|
||||||
# this should use new roledepenencies code
|
if not role_data:
|
||||||
#if not no_deps and installed:
|
role_data = gr.get_metadata(role.get("name"), options)
|
||||||
# if not role_data:
|
role_dependencies = role_data['dependencies']
|
||||||
# role_data = gr.get_metadata(role.get("name"), options)
|
else:
|
||||||
# role_dependencies = role_data['dependencies']
|
role_dependencies = role_data['summary_fields']['dependencies'] # api_fetch_role_related(api_server, 'dependencies', role_data['id'])
|
||||||
# else:
|
for dep in role_dependencies:
|
||||||
# role_dependencies = role_data['summary_fields']['dependencies'] # api_fetch_role_related(api_server, 'dependencies', role_data['id'])
|
self.display.debug('Installing dep %s' % dep)
|
||||||
# for dep in role_dependencies:
|
if isinstance(dep, basestring):
|
||||||
# if isinstance(dep, basestring):
|
dep = ansible.utils.role_spec_parse(dep)
|
||||||
# dep = ansible.utils.role_spec_parse(dep)
|
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):
|
if dep not in roles_left:
|
||||||
# if dep not in roles_left:
|
self.display.display('- adding dependency: %s' % dep["name"])
|
||||||
# print '- adding dependency: %s' % dep["name"]
|
roles_left.append(dep)
|
||||||
# roles_left.append(dep)
|
else:
|
||||||
# else:
|
self.display.display('- dependency %s already pending installation.' % dep["name"])
|
||||||
# print '- dependency %s already pending installation.' % dep["name"]
|
else:
|
||||||
# else:
|
self.display.display('- 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:
|
||||||
self.display.warning("- %s was NOT installed successfully." % role.name)
|
self.display.warning("- %s was NOT installed successfully." % role.name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue