Enable configuration of borg user

This commit is contained in:
phil 2023-04-09 10:05:37 +02:00
parent dfbcbf3229
commit 202d6c3ef9
4 changed files with 23 additions and 9 deletions

View file

@ -15,6 +15,7 @@
name: "{{ borgmatic_timer_cron_name }}"
hour: "{{ borgmatic_timer_hour }}"
minute: "{{ borgmatic_timer_minute }}"
user: "{{ borg_user }}"
cron_file: "{{ borgmatic_timer_cron_name }}"
job: "borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} >/dev/null"

View file

@ -1,18 +1,30 @@
---
- name: "SSH | Ensure directory exist"
ansible.builtin.file:
path: "{{ borg_user }}/.ssh/"
state: directory
mode: "0700"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
- name: "SSH | Generate an OpenSSH keypair"
community.crypto.openssh_keypair:
path: "{{ borg_ssh_key_file_path }}"
type: "{{ borg_ssh_key_type }}"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
- name: "SSH | Ensure configuration file is present"
ansible.builtin.file:
path: "{{ ssh_config_path }}"
path: "{{ borg_user_ssh_config_path }}"
state: touch
mode: "644"
owner: "{{ borg_user }}"
group: "{{ borg_group }}"
- name: "SSH | Insert borgbase configuration"
ansible.builtin.blockinfile:
path: "{{ ssh_config_path }}"
path: "{{ borg_user_ssh_config_path }}"
marker: "### {mark} ANSIBLE MANAGED BLOCK"
block: |
Host *.repo.borgbase.com