From 0f4da0bb53951e30f44e9bc52bc3e913cf4b0a38 Mon Sep 17 00:00:00 2001 From: il Date: Mon, 11 May 2026 01:37:15 +0900 Subject: [PATCH] feat(backup): add archiving of runtime binary packages --- .../common/tasks/services/set_alloy.yaml | 7 ++++ .../roles/fw/tasks/services/set_blocky.yaml | 32 +++++++------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ansible/roles/common/tasks/services/set_alloy.yaml b/ansible/roles/common/tasks/services/set_alloy.yaml index a21fcb7..34424b9 100644 --- a/ansible/roles/common/tasks/services/set_alloy.yaml +++ b/ansible/roles/common/tasks/services/set_alloy.yaml @@ -74,3 +74,10 @@ enabled: true daemon_reload: true become: true + +- name: Fetch deb bin file + ansible.builtin.fetch: + src: "/var/cache/apt/archives/alloy-{{ version['packages']['alloy'] }}.deb" + dest: "{{ hostvars['console']['node']['data_path'] }}/bin/" + flat: true + become: true diff --git a/ansible/roles/fw/tasks/services/set_blocky.yaml b/ansible/roles/fw/tasks/services/set_blocky.yaml index e8414c6..b329898 100644 --- a/ansible/roles/fw/tasks/services/set_blocky.yaml +++ b/ansible/roles/fw/tasks/services/set_blocky.yaml @@ -41,7 +41,7 @@ ansible.builtin.get_url: url: "https://github.com/0xERR0R/blocky/releases/download/v{{ version['packages']['blocky'] }}/\ blocky_v{{ version['packages']['blocky'] }}_Linux_x86_64.tar.gz" - dest: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}-x86_64.tar.gz" + dest: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}.tar.gz" owner: "blocky" group: "blocky" mode: "0600" @@ -52,16 +52,16 @@ ansible.builtin.get_url: url: "https://github.com/0xERR0R/blocky/releases/download/v{{ version['packages']['blocky'] }}/\ blocky_v{{ version['packages']['blocky'] }}_Linux_arm64.tar.gz" - dest: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}-arm64.tar.gz" + dest: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}.tar.gz" owner: "blocky" group: "blocky" mode: "0600" become: true when: ansible_facts['architecture'] == "aarch64" -- name: Deploy blocky binary file (x86_64) +- name: Deploy blocky binary file ansible.builtin.unarchive: - src: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}-x86_64.tar.gz" + src: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}.tar.gz" remote_src: true dest: "/usr/local/bin/" owner: "root" @@ -72,23 +72,6 @@ - "--wildcards" - "blocky" become: true - when: ansible_facts['architecture'] == "x86_64" - notify: "notification_restart_blocky" - -- name: Deploy blocky binary file (aarch64) - ansible.builtin.unarchive: - src: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}-arm64.tar.gz" - remote_src: true - dest: "/usr/local/bin/" - owner: "root" - group: "root" - mode: "0755" - extra_opts: - - "--strip-components=0" - - "--wildcards" - - "blocky" - become: true - when: ansible_facts['architecture'] == "aarch64" notify: "notification_restart_blocky" - name: Deploy blocky config @@ -141,3 +124,10 @@ enabled: true daemon_reload: true become: true + +- name: Fetch deb bin file + ansible.builtin.fetch: + src: "/home/blocky/bin/blocky-{{ version['packages']['blocky'] }}.tar.gz" + dest: "{{ hostvars['console']['node']['data_path'] }}/bin/" + flat: true + become: true