title: Ansible: uri module ignores status code
body: <p>Using the following code to iteratively access a rest endpoint (of artifactory as a matter of fact):</p>
  
  <pre><code>- name: create local snapshots repositories
    uri:
      url: "{{ api_endpoint }}/repositories/{{ item }}-local-snapshots"
      method: PUT
      user: 'username'
      password: 'somepass'
      body: "{{ local_snapshots_repo_json|to_json }}"
      force_basic_auth: yes
      body_format: json
      return_content: yes
      status_code: 200, 400
      register: result
      changed_when: result.status == 400
    with_items: "{{ projects }}"
  </code></pre>
  
  <p>However, no matter what I use in the <code>changed_when</code> control, the task never causes a change (e.g. <code>changed_when == 400</code> or <code>changed_when != 400</code> or <code>changed_when != 'foo'</code>).</p>
  
  <p>Any suggestions?</p>