Allow skipping specific parts of the role

Signed-off-by: Leonidas Avdelas <avdelasleonidas@gmail.com>
This commit is contained in:
Leonidas Avdelas 2025-10-31 18:36:09 +02:00
parent a960af0cf4
commit a06365d34b
2 changed files with 4 additions and 2 deletions

View File

@ -17,13 +17,15 @@
owner: "{{ borg_user }}" owner: "{{ borg_user }}"
group: "{{ borg_group }}" group: "{{ borg_group }}"
comment: "{{ borg_ssh_key_comment }}" 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 - name: Read SSH key
ansible.builtin.slurp: ansible.builtin.slurp:
src: "{{ borg_ssh_key_file_path }}.pub" src: "{{ borg_ssh_key_file_path }}.pub"
register: backup_local_ssh_key register: backup_local_ssh_key
when: borg_ssh_key_file_path is defined and borg_ssh_key_file_path | length > 0
- name: Print key - name: Print key
ansible.builtin.debug: ansible.builtin.debug:
msg: "The generated key is: {{ backup_local_ssh_key['content'] | b64decode }}" 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

View File

@ -16,4 +16,4 @@
mode: "0600" mode: "0600"
owner: "{{ borg_user }}" owner: "{{ borg_user }}"
group: "{{ borg_group }}" group: "{{ borg_group }}"
... when: borgmatic_config_name is defined and borgmatic_config_name | length > 0