ansible-role-borgbackup/tasks/storagebox.yml

11 lines
395 B
YAML
Raw Permalink Normal View History

2023-05-08 10:36:42 +02:00
---
- name: "Storagebox | Read key from file"
2023-05-08 11:21:21 +02:00
ansible.builtin.command:
cmd: "cat {{ borg_ssh_key_file_path }}.pub"
2023-05-08 10:36:42 +02:00
register: ssh_key
- name: "Storagebox | Copy key to Hetzner"
2023-05-08 15:29:47 +02:00
ansible.builtin.shell:
2023-05-08 11:21:21 +02:00
cmd: "echo {{ ssh_key.stdout_lines }} | ssh {{ hetzner_storagebox.user }}@{{ hetzner_storagebox.server }} -p {{ hetzner_storagebox.port }} install-ssh-key"
delegate_to: localhost