--- - hosts: all sudo: yes vars: packages: [rsync, git] tasks: - name: Install packages action: pacman pkg={{ item }} state=installed with_items: packages when: ansible_os_family == "Archlinux" # handlers: # - name: restart ntpd # action: service name=ntpd state=restarted