aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/client_setup.yml
diff options
context:
space:
mode:
authorColin Wilk <colin@wilk.cx>2026-06-28 22:47:11 +0200
committerColin Wilk <colin@wilk.cx>2026-06-28 23:18:35 +0200
commit7d96c1a11fc442b4efddf9ce5250cf0a9dfaf02e (patch)
tree5561dbeee61aaab05e21f3bc2895ff703a2ce137 /tasks/client_setup.yml
parent785e6c88e4c0a3ccc44fd357b4f693c5aadd432c (diff)
downloadansible-role-borgbackup-7d96c1a11fc442b4efddf9ce5250cf0a9dfaf02e.tar.gz
ansible-role-borgbackup-7d96c1a11fc442b4efddf9ce5250cf0a9dfaf02e.zip
Parametrize server-side borg user
Adds option to choose a non-default borg backup user on the server.
Diffstat (limited to 'tasks/client_setup.yml')
-rw-r--r--tasks/client_setup.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/tasks/client_setup.yml b/tasks/client_setup.yml
index 71027c3..fc32e03 100644
--- a/tasks/client_setup.yml
+++ b/tasks/client_setup.yml
@@ -77,8 +77,8 @@
ansible.builtin.file:
path: "{{ borg_server_user_home }}/.ssh/authorized_keys"
state: touch
- owner: borg
- group: borg
+ owner: "{{ borg_server_user }}"
+ group: "{{ borg_server_user }}"
mode: "0600"
access_time: preserve
modification_time: preserve
@@ -161,7 +161,7 @@
- name: Initialise Borg repository
ansible.builtin.command: >
borg init --encryption=repokey
- borg@{{ borg_server_host_url }}:{{ borg_server_user_home }}/{{ borg_repo_name }}
+ {{ borg_server_user }}@{{ borg_server_host_url }}:{{ borg_server_user_home }}/{{ borg_repo_name }}
environment:
BORG_PASSPHRASE: "{{ borg_passphrase }}"
BORG_RSH: "{{ ('ssh -i ' ~ borg_ssh_key_path) if borg_ssh_key_per_repo else omit }}"
@@ -202,7 +202,7 @@
- name: If host new read encryption keys
ansible.builtin.command: >
borg key export --paper
- borg@{{ borg_server_host_url }}:{{ borg_server_user_home }}/{{ borg_repo_name }}
+ {{ borg_server_user }}@{{ borg_server_host_url }}:{{ borg_server_user_home }}/{{ borg_repo_name }}
environment:
BORG_RSH: "{{ ('ssh -i ' ~ borg_ssh_key_path) if borg_ssh_key_per_repo else omit }}"
become: true