Here’s my ansible version:
ansible --version
ansible 1.4.4
I’m trying to get ansible to submit an http request for specific a url, and verify it gets a 301. It does not need to follow the location header and make the next http request.
I figured that follow_redirects=no would solve this for me, however I see ansible make the initial http request, receive a 301, then make the next http request and get a 200 back. It then fails because I’ve said status_code=301, it must only care about the second http request it made.
This is in my task:
- name: Make sure the HTTP Request gets a 301 redirect
action: uri url=http://{{ inventory_hostname }}.test.com/img/site.png status_code=301 HEADER_Host=“test.site.com” follow_redirects=no
delegate_to: 127.0.0.1
Any help would be appreciated.