|
|
@ -171,11 +171,17 @@ class Role(Base, Become, Conditional, Taggable):
|
|
|
|
|
|
|
|
|
|
|
|
task_data = self._load_role_yaml('tasks')
|
|
|
|
task_data = self._load_role_yaml('tasks')
|
|
|
|
if task_data:
|
|
|
|
if task_data:
|
|
|
|
self._task_blocks = load_list_of_blocks(task_data, play=self._play, role=self, loader=self._loader)
|
|
|
|
try:
|
|
|
|
|
|
|
|
self._task_blocks = load_list_of_blocks(task_data, play=self._play, role=self, loader=self._loader)
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
raise AnsibleParserError("The tasks/main.yml file for role '%s' must contain a list of tasks" % self._role_name , obj=task_data)
|
|
|
|
|
|
|
|
|
|
|
|
handler_data = self._load_role_yaml('handlers')
|
|
|
|
handler_data = self._load_role_yaml('handlers')
|
|
|
|
if handler_data:
|
|
|
|
if handler_data:
|
|
|
|
self._handler_blocks = load_list_of_blocks(handler_data, play=self._play, role=self, use_handlers=True, loader=self._loader)
|
|
|
|
try:
|
|
|
|
|
|
|
|
self._handler_blocks = load_list_of_blocks(handler_data, play=self._play, role=self, use_handlers=True, loader=self._loader)
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
raise AnsibleParserError("The handlers/main.yml file for role '%s' must contain a list of tasks" % self._role_name , obj=task_data)
|
|
|
|
|
|
|
|
|
|
|
|
# vars and default vars are regular dictionaries
|
|
|
|
# vars and default vars are regular dictionaries
|
|
|
|
self._role_vars = self._load_role_yaml('vars')
|
|
|
|
self._role_vars = self._load_role_yaml('vars')
|
|
|
|