With ssh tunnel, can not -m ping remote host successful

I have to use ssh tunnel to manage my hosts.

  1. create ssh tunnel “ssh -L 8082:: root@”
  2. edit host cfg
    [servers]
    server ansible_ssh_port=8082 ansible_ssh_host=127.0.0.1 ansible_ssh_user=root ansible_ssh_pass=xxxx

then use “ansible servers -m ping”

I got “FAILED => Authentication failure.”

But if i delete ansible_ssh_user, then use “ansible severs -m ping -k” and use password “xxxx”, i got success.

And if i use “sshpass -p xxxx ssh -p 8082 root@127.0.0.1”, i got success too.

I don’t know why…

Can anyone help me to solve this problem?