title: How to change a value assigned to a variable into integer in Ansible
body: <p>I am trying to compare two filesystem values <code>/var</code> and <code>/tmp</code> and as per the result need to execute the corresponding remediation playbook.</p>
  <pre class="lang-yaml prettyprint-override"><code>- name: check top utilized files.
    shell: du -sx --exclude=/proc --exclude=/sys* --exclude=/dev* --exclude=/u02* --exclude=/usr* --exclude=/boot* --exclude=/swapfile* --exclude=/run* -t 200M &quot;{{fs_input}}&quot;* | sort -n -r
    register: top_files
  
  - debug:
      msg: &quot;{{ top_files.stdout_lines }}&quot;
  
  - debug:
      msg: &quot;{{ item.split('\t/')[0]}}&quot;
    with_items: &quot;{{ top_files.stdout_lines[0] }}&quot;
    register: value1
  
  - debug:
      msg: &quot;{{ value1 |int * 1024 }}&quot;
  
  - debug:
      msg: &quot;{{ item.split('\t/')[0]}}&quot;
    with_items: &quot;{{ top_files.stdout_lines[1] }}&quot;
    register: value2
  
  - debug:
      msg: &quot;{{ value2 |int * 1024 }}&quot;
  </code></pre>
  <p>The debug value gives <code>0</code> as output.</p>