Execute commands remotely on a ubuntu

Hi everyone,

I am new user on ansible and I have a little difficulty to execute commands remotely on a Ubuntu Server. (Ubuntu don’t accept ssh with user root and the user vamberto can use sudo su - )
My machine is a Fedora Linux and I execute this command: ansible -vvv wolverine -m apt -a “update_cache=yes” --user=vamberto -k --become-method=su --become-user=root --ask-become-pass

And the server asks
SSH password:
SU password[defaults to SSH password]:

After I putt the ssh and su password I receive this error:

olverine | FAILED >> {
“failed”: true,
“msg”: “Failed to lock apt for exclusive operation”
}

Someone can help me ?

you can use sudo OR su but not chain them.

APT takes out a lock to ensure that only one instance of a package
manager is running. E.g. this can happen if you have synaptic open...

It is not an "ansible error" as such - just how the debian/ubuntu
package manager work...

Hope this helps