title: Writing variable content to file in ansible
body: <p>I trying to write variable content to file in ansible as follow what I not have lucky.</p>
  
  <p>tasks:</p>
  
  <pre><code>- name: Collect some information about rootvg space.
    raw: "df -h |grep /$ |awk -F / '{print $4}' |awk '{print $1}' |cut -d - -f1 |/usr/bin/xargs sudo /usr/sbin/vgs --noheading"
    register: res
  
  - name: Send to local file
    local_action: copy content="{{ res }}" dest="/tmp/rootvg_space.log"
  </code></pre>
  
  <p>Am I trying the correct way to do that?</p>