title: How to use AWK command via Ansible
body: <p>I have a problem with creating ansible role.</p>
  
  <p>I want to register variable via Ansible using awk in shell module.</p>
  
  <p>It work when i use it via terminal like that:</p>
  
  <pre><code>inxi -D | awk '/Total Size:/ {print $7}' | cut -d"(" -f2
  </code></pre>
  
  <p>But when I want to use it in Ansible role it doesnt work.</p>
  
  <pre><code>name: Get info
  shell: inxi -D | awk '/Total Size:/ {print $7}' | cut -d"(" -f2
  register: result
  </code></pre>
  
  <p>Displayed info from
  <code>inxi -D</code> is</p>
  
  <pre><code>Drives:    HDD Total Size: 53.7GB (2.0% used)
             ID-1: /dev/vda model: N/A size: 53.7GB
             ID-2: /dev/vdb model: N/A size: 0.0GB
  </code></pre>
  
  <p>And I want to extract data about usage fo HDD e.g. 2.0%</p>
  
  <p>Can someone help with that?</p>