|
|
@ -323,11 +323,16 @@ class GalaxyCLI(CLI):
|
|
|
|
if role_file:
|
|
|
|
if role_file:
|
|
|
|
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'):
|
|
|
|
|
|
|
|
try:
|
|
|
|
rolesparsed = map(self.parse_requirements_files, yaml.safe_load(f))
|
|
|
|
rolesparsed = map(self.parse_requirements_files, yaml.safe_load(f))
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
raise AnsibleError("%s does not seem like a valid yaml file" % role_file)
|
|
|
|
roles_left = [GalaxyRole(self.galaxy, **r) for r in rolesparsed]
|
|
|
|
roles_left = [GalaxyRole(self.galaxy, **r) for r in rolesparsed]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# roles listed in a file, one per line
|
|
|
|
# roles listed in a file, one per line
|
|
|
|
for rname in f.readlines():
|
|
|
|
for rname in f.readlines():
|
|
|
|
|
|
|
|
if rname.startswith("#") or rname.strip() == '':
|
|
|
|
|
|
|
|
continue
|
|
|
|
roles_left.append(GalaxyRole(self.galaxy, rname.strip()))
|
|
|
|
roles_left.append(GalaxyRole(self.galaxy, rname.strip()))
|
|
|
|
f.close()
|
|
|
|
f.close()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|