title: Ansible: How can I update the system CentOS with Ansible
body: <p>I am trying to update the CentOS systems with ansible. Unfortunately I am not able to do that.</p>
  
  <p>I already tried:</p>
  
  <pre><code>- name: install updates
    yum: update_cache=yes
    when: ansible_os_family == "RedHat
  </code></pre>
  
  <p>Isn't working.</p>
  
  <hr>
  
  <pre><code>- name: install updates
    yum: name=* state=latest
    when: ansible_os_family == "RedHat
  </code></pre>
  
  <p>The last task works but is it true, that the task updates the system?</p>