title: Ansible: how to register variable in uri module?
body: <p><br/>
  This is my code or checking wheter the website is valid and running:</p>
  
  <pre><code>  - hosts: master
      become: true
      tasks:
      - name: "Checking server availibility"
        uri:
          url: http://www.google.pl
          timeout: 5
        register: command_result
        ignore_errors: yes
  
      - debug: msg= "{{ command_result }}"
  </code></pre>
  
  <p>So <code>command_result</code> variable always returns this output regardless of the website availability:</p>
  
  <pre><code>ok: [Centos.v1] =&gt; {
      "changed": false,
      "msg": "Hello world!"
  }
  </code></pre>
  
  <p>I would like to know if the first task was succesful or not but i can't do that when the output of registered variable is always the same.
  <br/><br/>
  How to setup my variable properly to read the return code?<br/>
  and also <br/>
  Is there some other way to check if an error occured in the previous task? </p>