From 9fa3b233a932c1d32ad30ce5d04553c4c2f722fa Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 2 May 2024 09:42:19 +0930 Subject: [PATCH] feat(nfc_kubernetes): build url and on use cast as string !61 https://github.com/ansible/awx/issues/15161 closes #27 --- roles/nfc_kubernetes/tasks/k3s/install.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/nfc_kubernetes/tasks/k3s/install.yaml b/roles/nfc_kubernetes/tasks/k3s/install.yaml index 8a11cc0..7cbc697 100644 --- a/roles/nfc_kubernetes/tasks/k3s/install.yaml +++ b/roles/nfc_kubernetes/tasks/k3s/install.yaml @@ -304,16 +304,22 @@ when: > file_cached_k3s_binary.stat.checksum | default('0') != node_k3s.desired_hash - -- name: Download K3s Binary - ansible.builtin.uri: - url: |- + # Workaround. See: https://github.com/ansible/awx/issues/15161 +- name: Build K3s Download URL + ansible.builtin.set_fact: + cacheable: false + url_download_k3s: |- https://github.com/k3s-io/k3s/releases/download/ {{- node_k3s.desired_version | urlencode -}} /k3s {%- if cpu_arch.key == 'aarch64' -%} -arm64 {%- endif %} + + +- name: Download K3s Binary + ansible.builtin.uri: + url: "{{ url_download_k3s | string }}" method: GET return_content: false status_code: -- 2.49.0