I want to know about the inventory arguments

ansible_ssh_extra_args=‘-o PubkeyAuthentication=yes’ ,
ansible_ssh_extra_args=‘-o PubkeyAuthentication=no’

With any examples how it will work , can any one explain pls

The ansible_ssh_extra_args parameter in Ansible’s inventory file allows you to pass additional SSH options, such as enabling or disabling public key authentication. For instance, setting ansible_ssh_extra_args='-o PubkeyAuthentication=yes' enables public key authentication, while ansible_ssh_extra_args='-o PubkeyAuthentication=no' disables it. This parameter is specified per host in the inventory file, allowing fine-grained control over SSH options used by Ansible when connecting to remote hosts.

An example inventory could look like this:

[my_hosts]
host1 ansible_host=192.168.1.10 ansible_user=myuser ansible_ssh_extra_args='-o PubkeyAuthentication=no'
host2 ansible_host=192.168.1.11 ansible_user=myuser ansible_ssh_extra_args='-o PubkeyAuthentication=yes'

I mean any use case , any scenario
generally we use ansible_ssh_password or ssh-keygen and place and connect

Some older systems may only support password authentication.