From c87cae2437fba13f8b562beebc3af8a853d25474 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 4 Nov 2022 17:07:41 +0100 Subject: [PATCH] changed location for btrbk ssh keys --- host_files/btrbk/narwhal/btrbk.conf | 2 +- host_files/btrbk/suricata/btrbk.conf | 2 +- roles/btrbk/tasks/main.yml | 22 +++------------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/host_files/btrbk/narwhal/btrbk.conf b/host_files/btrbk/narwhal/btrbk.conf index 3909514..63606a5 100644 --- a/host_files/btrbk/narwhal/btrbk.conf +++ b/host_files/btrbk/narwhal/btrbk.conf @@ -11,7 +11,7 @@ archive_preserve 0h 1d 1w 1m 1y archive_preserve_min latest incremental yes -ssh_identity /var/lib/btrbk/.ssh/id_ed25519 +ssh_identity /etc/btrbk/id_ed25519 ssh_user btrbk backend btrfs-progs-doas diff --git a/host_files/btrbk/suricata/btrbk.conf b/host_files/btrbk/suricata/btrbk.conf index b71e4b7..bbc1bcb 100644 --- a/host_files/btrbk/suricata/btrbk.conf +++ b/host_files/btrbk/suricata/btrbk.conf @@ -11,7 +11,7 @@ archive_preserve 0h 1d 1w 1m 1y archive_preserve_min latest incremental yes -ssh_identity /var/lib/btrbk/.ssh/id_ed25519 +ssh_identity /etc/btrbk/id_ed25519 ssh_user btrbk backend btrfs-progs-doas diff --git a/roles/btrbk/tasks/main.yml b/roles/btrbk/tasks/main.yml index d134e75..eea5697 100644 --- a/roles/btrbk/tasks/main.yml +++ b/roles/btrbk/tasks/main.yml @@ -23,30 +23,17 @@ src: "host_files/btrbk/{{ ansible_hostname }}/btrbk.conf" dest: /etc/btrbk/btrbk.conf -- name: make btrbk user ssh directory - file: - state: directory - path: /var/lib/btrbk/.ssh - owner: btrbk - -- name: copy btrbk user ssh key +- name: copy btrbk ssh key copy: src: id_ed25519 - dest: /var/lib/btrbk/.ssh/id_ed25519 + dest: /etc/btrbk/id_ed25519 owner: btrbk mode: '0400' -- name: copy btrbk user ssh public key - copy: - src: id_ed25519.pub - dest: /var/lib/btrbk/.ssh/id_ed25519.pub - owner: btrbk - mode: '0644' - - name: copy btrbk user ssh public key to authorized_keys copy: src: id_ed25519.pub - dest: /var/lib/btrbk/.ssh/authorized_keys + dest: /etc/ssh/authorized_keys/btrbk owner: btrbk mode: '0644' @@ -54,7 +41,4 @@ lbu: include: - /usr/local/bin/btrbk - - /var/lib/btrbk/.ssh/id_ed25519 - - /var/lib/btrbk/.ssh/id_ed25519.pub - - /var/lib/btrbk/.ssh/authorized_keys when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]