Without sudo, is it possible to manage multiple become users with distinct passwords?

Apologies in advance if this issue has been answered already. My searches came up empty.

I have a playbook that uses multiple become users on each host. I’d like to have the playbook work with whatever become method the caller wants to use. I know the caller can use connection variables to define per-host become passwords, but is it possible to have passwords defined on a per-host/per-user basis?

Thanks,
Ed

[centos@testing ~]$ cat two_be.yml

I think you could set a become_password at this point.
become_password: foobar

Instead of using cleartext it might be better to have this in the
host_vars (maybe encrypted with ansible-vault) and just use the
variable here:

In the file host_vars/host_foo/some.yml:
become_password_for_user_xyz: secret

And then use "become_password: {{ become_password_for_user_xyz }}" in
your playbook.

Untested.

Johannes