From 8a3f8b757be1434df61abc0c0e491920b467ca26 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 1 Oct 2013 10:52:39 -0500 Subject: [PATCH] Make sure yaml data loaded for role is valid before using it Fixes #4322 --- lib/ansible/playbook/play.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 25c00afd2d1..a74b02a9c2d 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -449,7 +449,7 @@ class Play(object): include_file = template(dirname, tokens[0], mv) include_filename = utils.path_dwim(dirname, include_file) 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: if 'include' in x: x['role_name'] = new_role