title: How to get ansible facts in lower case
body: <p>I am gathering ansible facts . A serial number is coming in upper and lower case. see below.</p>
  
  <pre><code>5A2c32a-f1G85g-2035-0483-1fe9c129216d 
  </code></pre>
  
  <p>I need to compare that fact with another serial number which is in complete lower case.see below.</p>
  
  <pre><code>5a2c32a-f1g85g-2035-0483-1fe9c129216d 
  </code></pre>
  
  <p>If i use jinja2 filter to convert into lower case. Then i cannot manipulate the json ouput. For example. i tried this</p>
  
  <pre><code>- set_fact:
       facts: "{{ facts | lower | to_json }}"
  
  - debug:
      var: facts.instance
  </code></pre>
  
  <p>it throws error</p>
  
  <pre><code>TASK [play : set_fact] ******************************************************************************
  ok: [localhost]
  
  TASK [play : debug] ******************************************************************************
  ok: [localhost] =&gt; {
      "facts.instance": "VARIABLE IS NOT DEFINED!"
  }
  </code></pre>
  
  <p>But if i debug <code>facts</code> only. it gives me the output. below works,</p>
  
  <pre><code>- set_fact:
       facts: "{{ facts | lower | to_json }}"
  
  - debug:
      var: facts
  </code></pre>
  
  <p>but i need to get further value on <code>facts.instance.disk</code> etc</p>