- name: Upgrade packages
  become: true
  community.general.pacman:
    update_cache: true
    upgrade: true
  register: pacman_result
  notify: pacman_upgraded

- name: Reboot if necessary
  ansible.builtin.meta: flush_handlers