I am using the host file as shown below
[qa-workstations]
10.39.19.190 ansible_user=test ansible_ssh_pass=test
I use the command below to execute the whoami command in the host
root@Svr:~/ansible
10.39.19.190 | success | rc=0 >>
root
by default, it tries to use the username in which I logged in, i.e. root instead of the test user that I specified in the host file
It works fine when I try to pass the username in the unsible cli command
root@Svr:~/ansible
10.39.19.190 | success | rc=0 >>
test
But I will not be able to pass the username every time in the CLI, because the other host uses a different username. Also I do not have a key pair generated for each host, because the host machine often changes
Used version:
ansible 1.5.4
Ubuntu 14.04 LTS
source
share