ansible-roles/evobackup-client/tasks/ssh_key.yml
Patrick Marchand 53ae27b250
All checks were successful
continuous-integration/drone/push Build is passing
evobackup-client now uses the default ed25519 key of the server
We used to prefer creating a specific one for backups, but everybody
kept thinking the wrong key was being used and "fixing" it. The
advantages of having a specific key for backups did not outweigh
the challenge of creating a culture change.
2020-04-24 10:36:36 -04:00

32 lines
845 B
YAML

---
- name: Create SSH key
user:
name: root
generate_ssh_key: true
ssh_key_file: "{{ evobackup_client__root_key_path }}"
ssh_key_type: "{{ evobackup_client__root_key_type }}"
register: evobackup_client__root_key
tags:
- evobackup_client
- evobackup_client_backup_ssh_key
- name: Print SSH key
debug:
var: evobackup_client__root_key.ssh_public_key
when: evobackup_client__root_key.ssh_public_key is defined
tags:
- evobackup_client
- evobackup_client_backup_ssh_key
- name: 'copy ssh public key to backup server'
copy:
content: "{{ evobackup_client__root_key.ssh_public_key }}"
dest: "/root/{{ evolinux_hostname }}.pub"
become: true
delegate_to: "{{ evobackup_client__hosts[0].ip }}"
tags:
- evobackup_client
- evobackup_client_backup_ssh_key
- evobackup_client_jail