title: Ansible: error while evaluating conditional
body: <p>What am I doing wrong with this playbook?</p>
  <pre><code>$ cat check_only_centos7_tmp.yml
  - hosts: myhosts
    become: yes
    gather_facts: no
    tasks:
          - name: Check Uptime
            command: uptime
            when: ansible_distribution == &quot;CentOS&quot;
  </code></pre>
  <p>Error:</p>
  <pre><code>fatal: [server.myhost.com]: FAILED! =&gt; {&quot;msg&quot;: &quot;The conditional check 'ansible_distribution == \&quot;CentOS\&quot;' failed. The error was: error while evaluating conditional (ansible_distribution == \&quot;CentOS\&quot;): 'ansible_distribution' is undefined\n\nThe error appears to be in '/home/user/ansible_playbooks/check_only_centos7_tmp.yml': line 11, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n        - name: Check Uptime\n          ^ here\n&quot;}
  </code></pre>