|
|
@ -154,8 +154,7 @@ class GalaxyCLI(CLI):
|
|
|
|
option --ignore-errors was specified
|
|
|
|
option --ignore-errors was specified
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if not self.get_opt("ignore_errors", False):
|
|
|
|
if not self.get_opt("ignore_errors", False):
|
|
|
|
self.display.error('- you can use --ignore-errors to skip failed roles and finish processing the list.')
|
|
|
|
raise AnsibleError('- you can use --ignore-errors to skip failed roles and finish processing the list.')
|
|
|
|
return rc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def execute_init(self):
|
|
|
|
def execute_init(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -321,20 +320,24 @@ class GalaxyCLI(CLI):
|
|
|
|
roles_done = []
|
|
|
|
roles_done = []
|
|
|
|
roles_left = []
|
|
|
|
roles_left = []
|
|
|
|
if role_file:
|
|
|
|
if role_file:
|
|
|
|
f = open(role_file, 'r')
|
|
|
|
try:
|
|
|
|
if role_file.endswith('.yaml') or role_file.endswith('.yml'):
|
|
|
|
f = open(role_file, 'r')
|
|
|
|
try:
|
|
|
|
if role_file.endswith('.yaml') or role_file.endswith('.yml'):
|
|
|
|
rolesparsed = map(self.parse_requirements_files, yaml.safe_load(f))
|
|
|
|
try:
|
|
|
|
except:
|
|
|
|
rolesparsed = map(self.parse_requirements_files, yaml.safe_load(f))
|
|
|
|
raise AnsibleError("%s does not seem like a valid yaml file" % role_file)
|
|
|
|
except Exception as e:
|
|
|
|
roles_left = [GalaxyRole(self.galaxy, **r) for r in rolesparsed]
|
|
|
|
raise AnsibleError("%s does not seem like a valid yaml file: %s" % (role_file, str(e)))
|
|
|
|
else:
|
|
|
|
roles_left = [GalaxyRole(self.galaxy, **r) for r in rolesparsed]
|
|
|
|
# roles listed in a file, one per line
|
|
|
|
else:
|
|
|
|
for rname in f.readlines():
|
|
|
|
# roles listed in a file, one per line
|
|
|
|
if rname.startswith("#") or rname.strip() == '':
|
|
|
|
self.display.deprecated("Non yaml files for role requirements")
|
|
|
|
continue
|
|
|
|
for rname in f.readlines():
|
|
|
|
roles_left.append(GalaxyRole(self.galaxy, rname.strip()))
|
|
|
|
if rname.startswith("#") or rname.strip() == '':
|
|
|
|
f.close()
|
|
|
|
continue
|
|
|
|
|
|
|
|
roles_left.append(GalaxyRole(self.galaxy, rname.strip()))
|
|
|
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
except (IOError,OSError) as e:
|
|
|
|
|
|
|
|
raise AnsibleError("Unable to read requirements file (%s): %s" % (role_file, str(e)))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# roles were specified directly, so we'll just go out grab them
|
|
|
|
# roles were specified directly, so we'll just go out grab them
|
|
|
|
# (and their dependencies, unless the user doesn't want us to).
|
|
|
|
# (and their dependencies, unless the user doesn't want us to).
|
|
|
|