--- - hosts: all pre_tasks: - name: Update apt cache. apt: update_cache=yes when: ansible_os_family == 'Debian' roles: - role_under_test