Updating from 7.10.2 to 7.11.0, ansible started erroring:
TASK [elastic.elasticsearch : List Native Roles] ****
fatal: [...]: FAILED! => {"changed": false, "content": "{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"request [GET /_security/role_mapping] does not support having a body\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"request [GET /_security/role_mapping] does not support having a body\"},\"status\":400}", "content_length": "273", "content_type": "application/json; charset=UTF-8", "elapsed": 0, "json": {"error": {"reason": "request [GET /_security/role_mapping] does not support having a body", "root_cause": [{"reason": "request [GET /_security/role_mapping] does not support having a body", "type": "illegal_argument_exception"}], "type": "illegal_argument_exception"}, "status": 400}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "https://localhost:9200/_security/role_mapping"}
Updating from 7.10.2 to 7.11.0, ansible started erroring:
TASK [elastic.elasticsearch : List Native Roles] **** fatal: [...]: FAILED! => {"changed": false, "content": "{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"request [GET /_security/role_mapping] does not support having a body\"}],\"type\":\"illegal_argument_exception\",\"reason\":\"request [GET /_security/role_mapping] does not support having a body\"},\"status\":400}", "content_length": "273", "content_type": "application/json; charset=UTF-8", "elapsed": 0, "json": {"error": {"reason": "request [GET /_security/role_mapping] does not support having a body", "root_cause": [{"reason": "request [GET /_security/role_mapping] does not support having a body", "type": "illegal_argument_exception"}], "type": "illegal_argument_exception"}, "status": 400}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "status": 400, "url": "https://localhost:9200/_security/role_mapping"}
The error actually happens in 2 places.
Here's the fix: