- hosts: localhost pre_tasks: - name: verify running as root fail: when: ansible_user_id != "root" roles: - role: workstation