- hosts: debianvms
  become: true
  tasks:
    - name: Run apt-get update
      apt: update_cache=yes force_apt_get=yes

    - name: Upgrade all packages on servers
      apt: upgrade=dist force_apt_get=yes

    - name: Check if a reboot is required
      register: reboot_required_file
      stat: path=/var/run/reboot-required get_md5=no