mirror of
https://github.com/borgbase/ansible-role-borgbackup.git
synced 2026-01-14 20:06:45 +01:00
Allow skipping SSH key and config generation
Add when conditions to skip SSH key generation and borgmatic config creation when corresponding variables are empty. This allows users to install only borg/borgmatic without configuring them. Closes #188 #152 Co-Authored-By: Leonidas Avdelas <avdelasleonidas@gmail.com>
This commit is contained in:
parent
c6dd6f9a70
commit
51e099e553
@ -17,13 +17,16 @@
|
||||
owner: "{{ borg_user }}"
|
||||
group: "{{ borg_group }}"
|
||||
comment: "{{ borg_ssh_key_comment }}"
|
||||
when: borg_ssh_key_file_path is defined and borg_ssh_key_file_path | length > 0
|
||||
|
||||
- name: Read SSH key
|
||||
ansible.builtin.slurp:
|
||||
src: "{{ borg_ssh_key_file_path }}.pub"
|
||||
register: backup_local_ssh_key
|
||||
when: borg_ssh_key_file_path is defined and borg_ssh_key_file_path | length > 0
|
||||
|
||||
- name: Print key
|
||||
ansible.builtin.debug:
|
||||
msg: "The generated key is: {{ backup_local_ssh_key['content'] | b64decode }}"
|
||||
when: borg_ssh_key_file_path is defined and borg_ssh_key_file_path | length > 0
|
||||
...
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
---
|
||||
- name: Add Borgmatic config file
|
||||
when: borgmatic_config_name is defined and borgmatic_config_name | length > 0
|
||||
block:
|
||||
- name: Get Borgmatic version
|
||||
ansible.builtin.command: borgmatic --version
|
||||
|
||||
Loading…
Reference in New Issue
Block a user