--- - name: Download helm binary get_url: url: "{{ k3s_helm_url }}" dest: "/tmp/helm-{{ k3s_helm_version }}.tar.gz" when: ansible_facts.architecture == "x86_64" - 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: "{{ 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 }}"