how to specify user name in host file of ansible
问题 I am using the host file as below, [qa-workstations] 10.39.19.190 ansible_user=test ansible_ssh_pass=test I am using below command to execute "whoami" command in host root@Svr:~/ansible# ansible all -a "whoami" -i /etc/ansible/host 10.39.19.190 | success | rc=0 >> root ansible by default trying to use user name in which I have logged in, i.e root instead of test user which I have specified in host file It works fine when I try to pass the username in ansible cli command root@Svr:~/ansible#