1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make sure yaml data loaded for role is valid before using it

Fixes #4322
This commit is contained in:
James Cammarata 2013-10-01 10:52:39 -05:00
parent bff47df5ff
commit 8a3f8b757b

View file

@ -449,7 +449,7 @@ class Play(object):
include_file = template(dirname, tokens[0], mv) include_file = template(dirname, tokens[0], mv)
include_filename = utils.path_dwim(dirname, include_file) include_filename = utils.path_dwim(dirname, include_file)
data = utils.parse_yaml_from_file(include_filename) data = utils.parse_yaml_from_file(include_filename)
if 'role_name' in x: if 'role_name' in x and data is not None:
for x in data: for x in data:
if 'include' in x: if 'include' in x:
x['role_name'] = new_role x['role_name'] = new_role