Indeed, this looks like a bug. It looks like this pull request may have introduced it:
https://github.com/ansible/ansible/commit/5c0daf9e0a3a58253df61e56e39333637202cd12 since it looks like it's unconditionally setting 'follow_redirects' to true. Not sure what the logic is/was here. I'll file a bug on this and ping the author of the pull request. Romeo On Mon, Jan 20, 2014 at 2:50 PM, Michael DeHaan <[email protected]> wrote: > Sounds like this should be filed as a bug to me. > > If you are interested in poking around here and taking a look at things, > here's the source: > https://github.com/ansible/ansible/blob/devel/library/network/uri > > > > > On Mon, Jan 20, 2014 at 3:44 PM, bennett ponder <[email protected]> > wrote: >> >> 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. >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > Michael DeHaan <[email protected]> > CTO, AnsibleWorks, Inc. > http://www.ansibleworks.com/ > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- Romeo -- 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
