Multiple status_code in Ansible uri module
Per uri
module manual:
status_code
A valid, numeric, HTTP status code that signifies success of the request. Can also be comma separated list of status codes.
So:
- uri:
url: "http://mywebsite.org/api/hooks/release/builtin/"
method: POST
HEADER_Content-Type: "application/json"
body: '{"version": "6.2.10"}'
body_format: json
status_code: 201, 208
register: result