ansible-role-borgbackup/tasks/storagebox.yml

16 lines
638 B
YAML
Raw 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 11:21:21 +02:00
ansible.builtin.command:
cmd: "echo {{ ssh_key.stdout_lines }} | ssh {{ hetzner_storagebox.user }}@{{ hetzner_storagebox.server }} -p {{ hetzner_storagebox.port }} install-ssh-key"
delegate_to: localhost
- name: "Storagebox | Create backup directories"
ansible.builtin.command:
cmd: "ssh {{ hetzner_storagebox.user }}@{{ hetzner_storagebox.server}} -p {{ hetzner_storagebox.port }} mkdir -p {{ borg_repo_path }}"
delegate_to: localhost