ansible-role-borgbackup/tasks/ssh.yml
2023-04-08 22:34:19 +02:00

19 lines
557 B
YAML

---
- name: "SSH | Generate an OpenSSH keypair"
community.crypto.openssh_keypair:
path: "{{ borg_ssh_key_file_path }}"
type: "{{ borg_ssh_key_type }}"
- name: "SSH | Ensure configuration file is present"
ansible.builtin.file:
path: "{{ ssh_config_path }}"
state: touch
mode: "644"
- name: "SSH | Insert borgbase configuration"
ansible.builtin.blockinfile:
path: "{{ ssh_config_path }}"
marker: "### {mark} ANSIBLE MANAGED BLOCK"
block: |
Host *.repo.borgbase.com
IdentityFile {{ borg_ssh_key_file_path }}