Is it possible to use the su and sudo at the task?

Hi,

I’m trying to use Ansible in my production.

I’d like to do the following command in Ansible.
Is it possible?

$ ssh user_a@xxx $ su user_b $ sudo xxx

In my production,
user_a is only user allowed to SSH connection.
And user_b is only user allowed to become sudo.

In this situation, is there any good idea?

You cannot chain privilege escalation methods within Ansible, you CAN use become + shell: su ....