Enforce the _raw_params variable with include_role (#26430)

Currently, when using this test, it fails with the following error
message:

> AttributeError: 'NoneType' object has no attribute 'rfind'

This is because there is no _raw_params value for parent_include.args
here
https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/included_file.py#L104

This commit ensure the value is specified so it can be reused and hence
not fail at this specific line.
This commit is contained in:
Yanis Guenane 2017-07-05 16:53:10 +02:00 committed by John R Barker
parent 95a0fe37da
commit 05477412ba

View file

@ -18,6 +18,7 @@
- block:
- include_role:
name: openvswitch_db
_raw_params: openvswitch_db
when: "limit_to in ['*', 'openvswitch_db']"
rescue:
- set_fact: test_failed=true
@ -27,4 +28,4 @@
- name: Has any previous test failed?
fail:
msg: "One or more tests failed, check log for details"
when: test_failed
when: test_failed