Can anyone please help with steps to change default ssh user to some other user for ansible host
Edit the Inventory File and you can specify the SSH user for individual hosts or for groups of hosts.
For an Individual Host: Add the ansible_user
variable to the host definition.
[mygroup]
myhost1 ansible_host=192.0.2.1 ansible_user=mynewuser
For a Group of Hosts: Use the ansible_user
variable under the group definition.
[mygroup:vars]
ansible_user=mynewuser
Or if you want to change the user on the command line use -u
or --user