ansible-role-borgbackup/tasks/ssh.yml

20 lines
557 B
YAML
Raw Normal View History

2023-04-08 22:33:17 +02:00
---
- 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_name }}"
state: touch
mode: "644"
- name: "SSH | Insert borgbase configuration"
ansible.builtin.blockinfile:
path: "{{ ssh_config_name }}"
marker: "### {mark} ANSIBLE MANAGED BLOCK"
block: |
Host *.repo.borgbase.com
IdentityFile {{ borg_ssh_key_file_path }}