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

44 views
Skip to first unread message

Yogesh Darji

unread,
Oct 13, 2016, 11:10:44 AM10/13/16
to Ansible Project
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", "x_marathon_leader": "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

Dick Davies

unread,
Oct 13, 2016, 2:17:18 PM10/13/16
to ansible list
Set a status_code: field to the value marathon returns, it looks like
you are getting a 200 and ansible is expecting a 201.

On 12 October 2016 at 17:00, Yogesh Darji
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b80ef440-2fd5-4f3c-8199-0f8147c5c09e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages