How I used Ansible to automate updates at home | Enable Sysadmin
www.redhat.com › sysadmin › ansible-automate-updatesMar 11, 2021 · --- - hosts: yum tasks: - name: Update all installed packages using YUM module yum: name: '*' state: latest update_cache: yes update_only: yes register: yum_update_status - name: Remove packates not needed anymore yum: autoremove: yes - name: Reboot when packages were updated reboot: when: yum_update_status.changed - hosts: apt tasks: - name: Update all installed packages using APT module apt: name: '*' state: latest update_cache: yes only_upgrade: yes register: apt_update_status - name ...