diff --git a/lib/ansible/modules/extras/notification/campfire.py b/lib/ansible/modules/extras/notification/campfire.py index 7871747bec..3d003e1363 100644 --- a/lib/ansible/modules/extras/notification/campfire.py +++ b/lib/ansible/modules/extras/notification/campfire.py @@ -117,14 +117,14 @@ def main(): # Send some audible notification if requested if notify: response, info = fetch_url(module, target_url, data=NSTR % cgi.escape(notify), headers=headers) - if info['status'] != 200: - module.fail_json(msg="unable to send msg: '%s', campfire api" - " returned error code: '%s'" % - (notify, info['status'])) + if info['status'] not in [200, 201]: + module.fail_json(msg="unable to send msg: '%s', campfire api" + " returned error code: '%s'" % + (notify, info['status'])) # Send the message response, info = fetch_url(module, target_url, data=MSTR %cgi.escape(msg), headers=headers) - if info['status'] != 200: + if info['status'] not in [200, 201]: module.fail_json(msg="unable to send msg: '%s', campfire api" " returned error code: '%s'" % (msg, info['status']))