ceth
ceth

Reputation: 45325

Looks like my `ansible_ssh_pass` is ignoring in the inventory file

Here is my inventory file:

web1 ansible_ssh_host=192.168.33.20
db1 ansible_ssh_host=192.168.33.30

[webservers]
web1

[dbservers]
db1

[datacenter:children]
webservers
dbservers

[datacenter:vars]
ansible_ssh_user=vagrant
ansible_ssh_pass=vagrant

When I am trying to:

ansible datacenter -i inventory -u vagrant -m ping -k

Ansible ask me to pass SSH password:

SSH password: 

Why and how to say Ansible to use password from my inventory file ?

Upvotes: 0

Views: 691

Answers (1)

helloV
helloV

Reputation: 52443

To answer your question -k is same as --ask-pass

Try:

ansible datacenter -i inventory -u vagrant -m ping

Upvotes: 1

Related Questions