title: set_fact is not persisting
body: <p>I am using ansible 2.0.1 on RHEL 7 hosts. Somehow following roles when called through playbook skips the Get  the yellow major version.
  Attaching output below. Looks like there is something wrong with the when condition.</p>
  
  <hr>
  
  <pre><code>  - set_fact: is_yos="true"
  
    - name: Fetch yellow version
      shell: /bin/gawk '{ for(col = 1; col &lt;= NF; col++) if ($col ~ /[0-9.]+/) { print $col; } }' /etc/yellow-release
      register: yel_ver_str
      failed_when: false
      changed_when: false
  
    - set_fact:
        is_yos: "false"
      when: yel_ver_str.rc != 0
  
    - debug: var=yel_ver_str
  
    - debug: var=is_yos
  
    - name: Get yellow major version.
      shell: echo {{ yel_ver_str.stdout }} | awk -F. '{print $1}'
      register: yel_major_ver
      when: is_yos == "true"
      delegate_to: localhost
      changed_when: false
  </code></pre>
  
  <p>Output </p>
  
  <pre><code>ansible-playbook -i hosts test.yml -c local
  
  PLAY ***************************************************************************
  
  TASK [setup] *******************************************************************
  ok: [172.31.83.23]
  
  TASK [test : set_fact] *********************************************************
  ok: [172.31.83.23]
  
  TASK [test : Fetch yellow version] *********************************************
  ok: [172.31.83.23]
  
  TASK [test : set_fact] *********************************************************
  skipping: [172.31.83.23]
  
  TASK [test : debug] ************************************************************
  ok: [172.31.83.23] =&gt; {
      "yel_ver_str": {
          "changed": false,
          "cmd": "/bin/gawk '{ for(col = 1; col &lt;= NF; col++) if ($col ~ /[0-9.]+/) { print $col; } }' /etc/yellow-release",
          "delta": "0:00:00.004225",
          "end": "2016-04-22 13:37:29.517570",
          "failed": false,
          "failed_when_result": false,
          "rc": 0,
          "start": "2016-04-22 13:37:29.513345",
          "stderr": "",
          "stdout": "7.2.0",
          "stdout_lines": [
              "7.2.0"
          ],
          "warnings": []
      }
  }
  
  TASK [test : debug] ************************************************************
  ok: [172.31.83.23] =&gt; {
      "is_yos": true
  }
  
  TASK [test : Get yellow major version.] ****************************************
  skipping: [172.31.83.23]
  
  PLAY RECAP *********************************************************************
  172.31.83.23               : ok=5    changed=0    unreachable=0    failed=0
  </code></pre>