From a06365d34b4d5c013a2e265f5c207355f7d8e769 Mon Sep 17 00:00:00 2001 From: Leonidas Avdelas Date: Fri, 31 Oct 2025 18:36:09 +0200 Subject: [PATCH] Allow skipping specific parts of the role Signed-off-by: Leonidas Avdelas --- tasks/03_create_key.yml | 4 +++- tasks/05_configure.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/03_create_key.yml b/tasks/03_create_key.yml index 3887856..a282b47 100644 --- a/tasks/03_create_key.yml +++ b/tasks/03_create_key.yml @@ -17,13 +17,15 @@ 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 diff --git a/tasks/05_configure.yml b/tasks/05_configure.yml index e055c20..9149c77 100644 --- a/tasks/05_configure.yml +++ b/tasks/05_configure.yml @@ -16,4 +16,4 @@ mode: "0600" owner: "{{ borg_user }}" group: "{{ borg_group }}" -... + when: borgmatic_config_name is defined and borgmatic_config_name | length > 0