- hosts: all tasks: - name: Get user id command: id register: user_id - name: Display user id ansible.builtin.debug: var: user_id.stdout