title: Ansible yum update --security
body: <p>I'm working with the yum module on ansible.
  I'm trying to do what would be on RHEL yum update --security
  My Ansible playbook looks like</p>
  
  <pre><code> tasks:
     - name: checking updates
       yum:
               list: security
       register: output
       become: true
  
     - debug:
           msg: "{{ output }}"
  </code></pre>
  
  <p>the output it's</p>
  
  <pre><code>"msg": {
          "ansible_facts": {
              "discovered_interpreter_python": "/usr/bin/python"
          },
          "changed": false,
          "failed": false,
          "results": []
      }
  
  </code></pre>
  
  <p>what I'm looking it's something like </p>
  
  <pre><code>11 package(s) needed for security, out of 204 available
  
  kernel.x86_64                                             3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  kernel-devel.x86_64                                       3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  kernel-headers.x86_64                                     3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  kernel-tools.x86_64                                       3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  kernel-tools-libs.x86_64                                  3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  libicu.x86_64                                             50.2-4.el7_7                                     rhel-7-server-rpms
  python-perf.x86_64                                        3.10.0-1062.18.1.el7                             rhel-7-server-rpms
  tomcat-el-2.2-api.noarch                                  7.0.76-11.el7_7                                  rhel-7-server-rpms
  tomcat-jsp-2.2-api.noarch                                 7.0.76-11.el7_7                                  rhel-7-server-rpms
  tomcat-lib.noarch                                         7.0.76-11.el7_7                                  rhel-7-server-rpms
  tomcat-servlet-3.0-api.noarch                             7.0.76-11.el7_7                                  rhel-7-server-rpms
  
  </code></pre>
  
  <p>Using the shell module it actually gives me back the result but as an error due that I shouldn't be using shell module</p>
  
  <pre><code> #   - name: checking update with shell
           #     shell: "yum --security check-update"
           #     register: shel_outp
           #     become: true
  
           #   - debug:
           #           msg: "{{ shel_outp.stdout }}"
  
  </code></pre>
  
  <p>does anyone have a solution for this kind of issue?
  Thanks.</p>