![]() rw- – 1 weblogic weblogic 1675 Sep 10 17:25 /home/weblogic/.ssh/id_rsa rw- – 1 weblogic weblogic 1679 Sep 10 17:25 /home/weblogic/.ssh/id_rsa Step 2: Make sure the Private key file is created :~$ ansible app -m shell -a "ls -lrt ~/.ssh/id_rsa" -i ansible_hosts -b – become-user=weblogic Step 1: Create SSH Private key using SSH-KEYGEN for the user weblogic :~$ ansible app -m shell -a "ssh-keygen -q -b 2048 -t rsa -N '' -C 'creating SSH' -f ~/.ssh/id_rsa creates='~/.ssh/id_rsa'" -i ansible_hosts -b – become-user=weblogic to know more about ansible ad hoc command refer to this article ![]() In this method, we are going to use the Ansible ad hoc commands to perform the ssh key exchange and to copy the ssh keys between hosts. Let us consider that I have already grouped these servers into a host group named “ app” in ansible_hosts inventory fileĪnsible AD-HOC Commands – Ansible SSH Key Now we will see how to do this with both Ansible ad-hoc commands and playbook. We are going to see how to achieve our objective (or) requirement using Ansible ad-hoc command and ansible playbook with and without SSH authorized_key module.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |