From fe7813ad1a06dbaa7b6104fbd63bdb937814cfb0 Mon Sep 17 00:00:00 2001 From: OldTyT Date: Mon, 26 Feb 2024 11:40:33 +0000 Subject: [PATCH] fix: helm unpack --- tasks/installation_helm.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tasks/installation_helm.yml b/tasks/installation_helm.yml index b055449..6e0ab1c 100644 --- a/tasks/installation_helm.yml +++ b/tasks/installation_helm.yml @@ -5,11 +5,28 @@ dest: "/tmp/helm-{{ k3s_helm_version }}.tar.gz" when: ansible_facts.architecture == "x86_64" -- name: extract binary +- name: Create a directory to unpack Helm + tempfile: + state: directory + register: helm_unpack_directory + +- name: Unpack Helm tarball unarchive: src: "/tmp/helm-{{ k3s_helm_version }}.tar.gz" - dest: "{{ k3s_binary_dir }}/helm" - owner: root - group: "root" - mode: 0750 - remote_src: true + dest: "{{ helm_unpack_directory.path }}" + +- name: Move Helm to the desired installation directory + copy: + src: "{{ helm_unpack_directory.path }}/linux-amd64/helm" + dest: "{{ helm_install_directory }}/helm" + remote_src: yes + mode: '0755' + when: ansible_facts.architecture == "x86_64" + +- name: Clean up downloaded and unpacked files + file: + path: "{{ item }}" + state: absent + with_items: + - "/tmp/helm-{{ k3s_helm_version }}.tar.gz" + - "{{ helm_unpack_directory.path }}"