
name: insert public ssh key for user sahil

ssh directoryįile: path=/home/sahil/.ssh/authorized_keys state=touch mode=0644 Given below is Ansible Playbook For Copying SSH ~]$ cat ansible_work/ssh_key.yml

One could go as far as saying that we need some configuration management to be set prior to use Ansible for configuration management.Īs a workaround for this situation, today we will share a simple playbook to copy ssh keys for a user across hosts.
Ansible ssh copy id without password password#
As a result of this, we would require password-less ssh authentication to be set up otherwise using ansible for automation would not prove very helpful if we have to type in the password for every host on which are executing the playbook. Ansible often gets criticized for the fact that since it completely relies on the ssh protocol for implementing its automation. We’ve covered ansible installation, setup and basic playbook writing in earlier articles. Copying SSH keys to number of hosts manually will be difficult task. The main advantage that works in favor of Ansible is the fact that it is agent-less and therefore very easy to set up. Ansible playbook has been an increasingly popular configuration management and deployment tool in the last few years and is giving stiff competition to its competitors i.e, puppet, chef and saltstack.
