Hello folks
As a new learner, I am trying to copy the ssh pub key to the managed node as below.
ssh_install.yml
===
tasks:
- name: Exchange the pub key
authorized_key:
user: root
state: present
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
===
Running with below command
#ansible-playbook -i inventory ssh_install.yml -k
It is running without any issue but is there any way to avoid the -k option? I dont want to provide the password for each managed node in the command prompt.
Secondly using below task for changing the root password. I will use vault to store PLAIN_PASSWORD. Is there any better method to do it? Kindly advice.
password: "{{ 'PLAIN_PASSWORD' | password_hash('sha512') }}"