# Trying to delete a running app on Marathon by Ansible Playbook - Error

**URL:** <https://forum.ansible.com/t/trying-to-delete-a-running-app-on-marathon-by-ansible-playbook-error/22778>\
**Category:** Ansible Project\
**Created:** [October 12, 2016, 4:00pm UTC](https://forum.ansible.com/t/trying-to-delete-a-running-app-on-marathon-by-ansible-playbook-error/22778 "2016-10-12T16:00:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_Darji](https://avatars.discourse-cdn.com/v4/letter/y/779978/32.png) [@Yogesh\_Darji](https://forum.ansible.com/u/Yogesh_Darji)\
**Post date:** [October 12, 2016, 4:00pm UTC](https://forum.ansible.com/t/trying-to-delete-a-running-app-on-marathon-by-ansible-playbook-error/22778/1 "2016-10-12T16:00:38Z")

</div>

Hi,

I deployed an app on Marathon with POST using uri module. My inventory file has just localhost which I am using to execute my playbooks.

I have written a playbook to delete that app, it will successfully delete the app, but the only problem which I am facing is that I am getting below error with successful response code.

fatal: [localhost]: FAILED! =\> {“cache\_control”: “no-cache, no-store, must-revalidate”, “changed”: false, “connection”: “close”, “content”: “{"version":"2016-10-12T15:51:51.738Z","deploymentId":"f200ffd5-095f-4dd5-865b-4958f0d0adfc"}”, “content\_length”: “92”, “content\_type”: “application/json; qs=2”, “date”: “Wed, 12 Oct 2016 15:51:06 GMT”, “expires”: “0”, “failed”: true, “json”: {“deploymentId”: “f200ffd5-095f-4dd5-865b-4958f0d0adfc”, “version”: “2016-10-12T15:51:51.738Z”}, “msg”: “Status code was not [201]: OK (92 bytes)”, “pragma”: “no-cache”, “redirected”: false, “server”: “openresty/1.7.10.2”, “status”: 200, “url”: “[http://jmontesvm07.verizon.com:19092/v2/apps/demoansible](http://jmontesvm07.verizon.com:19092/v2/apps/demoansible)”, “x\_marathon\_leader”: “[http://10.200.161.1:31392](http://10.200.161.1:31392)”}

I am concerned about the highlighted error and I want to get rid of it.

The json response gives successful response with status 200. Can anyone help me with how to solve the highlighted error.

Thanks in advance.

-Yogesh Darji

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [October 13, 2016, 6:16pm UTC](https://forum.ansible.com/t/trying-to-delete-a-running-app-on-marathon-by-ansible-playbook-error/22778/2 "2016-10-13T18:16:21Z")

</div>

Set a status\_code: field to the value marathon returns, it looks like  
you are getting a 200 and ansible is expecting a 201.
