Skip to content

Commit 4c7f8d8

Browse files
stegmatzem3nu
authored andcommitted
Add option to set ssh key comment
1 parent c91bf0e commit 4c7f8d8

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

EXAMPLES.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
borg_repository: ssh://[email protected]/./repo
1111
borgmatic_timer: systemd
1212
borg_ssh_key_name: id_backup
13+
borg_ssh_key_comment: backup key
1314
borg_ssh_command: "ssh -i {{ borg_ssh_key_file_path }} -o StrictHostKeyChecking=accept-new"
1415
borg_user: backupuser
1516
borg_group: backupuser

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl
100100
- `borg_ssh_key_name`: Name of the SSH public and pivate key. Default `id_ed25519`
101101
- `borg_ssh_key_file_path`: SSH-key to be used. Default `~/.ssh/{{ borg_ssh_key_name }}`
102102
- `borg_ssh_key_type`: The algorithm used to generate the SSH private key. Choose: `rsa`, `dsa`, `rsa1`, `ecdsa`, `ed25519`. Default: `ed25519`
103+
- `borg_ssh_key_comment`: Comment added to the SSH public key.
103104
- `borg_ssh_command`: Command to use instead of just "ssh". This can be used to specify SSH options.
104105
- `borg_version`: Force a specific borg version to be installed
105106
- `borg_venv_path`: Path to store the venv for `borg(backup)` and `borgmatic`

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ borg_encryption_passcommand: false
77
borg_lock_wait_time: 5
88
borg_ssh_key_type: "ed25519"
99
borg_ssh_key_name: "id_{{ borg_ssh_key_type }}"
10+
borg_ssh_key_comment: ''
1011
borg_ssh_key_file_path: "{{ backup_user_info.home }}/.ssh/{{ borg_ssh_key_name }}"
1112
borg_ssh_command: false
1213
borg_remote_path: false

meta/argument_specs.yml

+4
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,7 @@ argument_specs:
192192
type: str
193193
required: false
194194
description: Name of the SSH public and private key
195+
borg_ssh_key_comment:
196+
type: str
197+
required: false
198+
description: Comment added to the SSH public key.

tasks/03_create_key.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
type: "{{ borg_ssh_key_type }}"
1717
owner: "{{ borg_user }}"
1818
group: "{{ borg_group }}"
19+
comment: "{{ borg_ssh_key_comment }}"
1920

2021
- name: Read SSH key
2122
ansible.builtin.slurp:

0 commit comments

Comments
 (0)