#!/usr/bin/ansible-playbook --- - name: test sudosu hosts: srvtest gather_facts: false become_method: community.general.sudosu become_user: testplop become: true tasks: - name: test command: id register: cmd_ls - name: test debug: var: cmd_ls.stdout_lines