How to specify ssh password in Ansible playbook

Usually Ansible is configuring with ssh key for login as its the secure way.

But in some cases we will be forced to use password instead of key for ssh.

Ansible have the option to specify the ssh username and password in inventory file itself.

[all:vars]
ansible_connection=ssh
ansible_user=
ansible_ssh_pass=

Here we just need to update the ssh username and password.

Please note that prior to Ansible 2.0 we need to use the variable ansible_ssh_user instead of ansible_user.

That's all…

Leave a Reply

Your email address will not be published. Required fields are marked *