title: ansible yum check update parse output to have list of packages
body: <p>I want to parse the output of yum check-update ansible equivalent to get only the list of package in human readable format.</p>
  
  <p>My code so far:</p>
  
  <pre><code>- name: check for updates
    hosts: localhost
    gather_facts: true
  
    tasks:
  
   - name: check for updates (yum)
     yum: list=updates update_cache=true
     register: yumoutput
     when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
   - debug: msg={{ yumoutput.stdout | from_json }}
  </code></pre>
  
  <p>but I get:</p>
  
  <blockquote>
    <p>fatal: [localhost]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ yumoutput.stdout | from_json }}): expected string or buffer"}</p>
  </blockquote>
  
  <p>EDIT: the complete playbook:</p>
  
  <pre><code>---
  - name: check for updates
    hosts: localhost
    gather_facts: true
  
    tasks:
    - name: check for updates (yum)
      yum: list=updates update_cache=true
      register: yumoutput
      when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
    - debug: var=yumoutput
      msg: "{{ yumoutput.results | map(attribute='name') | list }}
  </code></pre>