ansible-role-borgbackup/tasks/storagebox.yml
2023-05-08 15:29:47 +02:00

11 lines
395 B
YAML

---
- name: "Storagebox | Read key from file"
ansible.builtin.command:
cmd: "cat {{ borg_ssh_key_file_path }}.pub"
register: ssh_key
- name: "Storagebox | Copy key to Hetzner"
ansible.builtin.shell:
cmd: "echo {{ ssh_key.stdout_lines }} | ssh {{ hetzner_storagebox.user }}@{{ hetzner_storagebox.server }} -p {{ hetzner_storagebox.port }} install-ssh-key"
delegate_to: localhost