change to id_ed25519 keys

This commit is contained in:
Antonio J. Delgado 2023-01-29 10:21:59 +02:00
parent 4e39958093
commit d4322019d3

View file

@ -50,15 +50,15 @@
- name: Check if there is a public key - name: Check if there is a public key
stat: stat:
path: /root/.ssh/id_rsa.pub path: /root/.ssh/id_ed25519.pub
register: pubkey register: pubkey
- name: Generate new key if it doesn't exist already - name: Generate new key if it doesn't exist already
shell: ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N '' shell: ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N ''
when: not pubkey.stat.exists when: not pubkey.stat.exists
- name: Get SSH public key content - name: Get SSH public key content
shell: cat /root/.ssh/id_rsa.pub shell: cat /root/.ssh/id_ed25519.pub
register: ssh_pubkey register: ssh_pubkey
- name: Add SSH public key to local (Ansible control node) file - name: Add SSH public key to local (Ansible control node) file