diff --git a/plugins/module_utils/openstack.py b/plugins/module_utils/openstack.py index bece2664..0b618485 100644 --- a/plugins/module_utils/openstack.py +++ b/plugins/module_utils/openstack.py @@ -389,6 +389,14 @@ class OpenStackModule: if results and isinstance(results, dict): self.ansible.exit_json(**results) except self.sdk.exceptions.OpenStackCloudException as e: - self.ansible.fail_json(msg=str(e), extra_data=e.extra_data) + params = { + 'msg': str(e), + 'extra_data': { + 'data': e.extra_data, + 'details': e.details, + 'response': e.response.text + } + } + self.ansible.fail_json(**params) # if we got to this place, modules didn't exit self.ansible.exit_json(**self.results)