From 246905a2ee489fd6202276e3146a5fc35abe0660 Mon Sep 17 00:00:00 2001 From: Sergey Malyuk Date: Mon, 15 Dec 2025 12:20:12 +0300 Subject: [PATCH] fix ansible-lint errors --- roles/borgmatic/defaults/main.yml | 12 ++++++------ roles/borgmatic/tasks/handle-ssh-keys.yml | 6 +++--- roles/borgmatic/tasks/install.yml | 2 +- roles/borgmatic/tasks/run.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/borgmatic/defaults/main.yml b/roles/borgmatic/defaults/main.yml index 4cfd1c1..c96f1e8 100644 --- a/roles/borgmatic/defaults/main.yml +++ b/roles/borgmatic/defaults/main.yml @@ -1,12 +1,13 @@ --- borgmatic_version: "1.4.0" -glibc_version: "2.36" -pipx_version: "1.7.1" -borgmatic_binary_url: "https://github.com/borgbackup/borg/releases/download/{{ borgmatic_version }}/borg-linux-glibc{{ glibc_version | replace('.', '') }}.tgz" +borgmatic_glibc_version: "2.36" +borgmatic_pipx_version: "1.7.1" +borgmatic_binary_url: "\ + https://github.com/borgbackup/borg/releases/download/{{ borgmatic_version }}/borg-linux-glibc{{ borgmatic_glibc_version | replace('.', '') }}.tgz" borgmatic_pipx_bin_dir: "/opt/borgmatic/bin" borgmatic_schedule_oncalendar: "daily" -push_pubkey: true -ssh_key_path: "/root/borgmatic/id_ed25519" +borgmatic_push_pubkey: true +borgmatic_sshkey_path: "/root/borgmatic/id_ed25519" borgmatic_compression: "lz4" borgmatic_keep_hourly: 0 borgmatic_keep_daily: 3 @@ -15,4 +16,3 @@ borgmatic_keep_monthly: 1 borgmatic_keep_yearly: 0 borgmatic_uptime_kuma: borgmatic_loki: -# todo: ansible-lint errors \ No newline at end of file diff --git a/roles/borgmatic/tasks/handle-ssh-keys.yml b/roles/borgmatic/tasks/handle-ssh-keys.yml index 37db382..07e9c07 100644 --- a/roles/borgmatic/tasks/handle-ssh-keys.yml +++ b/roles/borgmatic/tasks/handle-ssh-keys.yml @@ -1,7 +1,7 @@ --- - name: "Ensure the path for SSH keys exists" ansible.builtin.file: - path: "{{ ssh_key_path | dirname }}" + path: "{{ borgmatic_sshkey_path | dirname }}" state: directory owner: root group: root @@ -11,13 +11,13 @@ register: borgmatic_ssh_key_pair community.crypto.openssh_keypair: type: ed25519 - path: "{{ ssh_key_path }}" + path: "{{ borgmatic_sshkey_path }}" comment: "Generated by Ansible for Borgmatic" force: false mode: '0600' - name: "Push the SSH key pair to the Borg repo host" - when: push_pubkey + when: borgmatic_push_pubkey delegate_to: "{{ repo_server_inventory_hostname }}" ansible.posix.authorized_key: user: "{{ repo_server_user }}" diff --git a/roles/borgmatic/tasks/install.yml b/roles/borgmatic/tasks/install.yml index 0e6d718..46f5203 100644 --- a/roles/borgmatic/tasks/install.yml +++ b/roles/borgmatic/tasks/install.yml @@ -13,7 +13,7 @@ retries: 3 delay: 1 ansible.builtin.pip: - name: "pipx=={{ pipx_version }}" + name: "pipx=={{ borgmatic_pipx_version }}" executable: pip3 break_system_packages: true diff --git a/roles/borgmatic/tasks/run.yml b/roles/borgmatic/tasks/run.yml index 182aa05..28051f5 100644 --- a/roles/borgmatic/tasks/run.yml +++ b/roles/borgmatic/tasks/run.yml @@ -16,7 +16,7 @@ vars: borgmatic_install: false # we handle installation separately to get the recent version # borgmatic_ssh_key_gen_options: "-t ed25519 -a 100" - borgmatic_ssh_key_path: "{{ ssh_key_path }}" + borgmatic_ssh_key_path: "{{ borgmatic_sshkey_path }}" borgmatic_schedule_on: "{{ borgmatic_schedule_oncalendar }}" borgmatic_schedule_max_random_delay: 600 borgmatic_config: "{{ borgmatic_composite_config }}"