title: undefined variable in ansible
body: <p>Below is the my ansible tasks which will fetch domain name and which will register the output to item value so that i can use the variable across my playbook.</p>
  
  <pre><code>- name: Fetching the domain name
    shell: dnsdomainname | cut -d "." -f 1
    register: domain_name
  
  - debug: 
       msg: "DC detected {{domain_name}}"
    when: domain_name.stdout == item.key
    with_dict: {abc: 01, cde: 05}
    register: number == item.value
  </code></pre>
  
  <p>But it was throwing the error as below:</p>
  
  <pre><code>fatal: [localhost]: FAILED! =&gt; {"msg": "The task includes an option with an undefined variable. The error was: 'number' is undefined\n\n
  </code></pre>
  
  <p>Any help will be appreciated .</p>