From a9e1a43b80bb44e47a1ad99f80f8630ba793f60e Mon Sep 17 00:00:00 2001 From: Yosafat Marselino Date: Fri, 16 May 2025 06:11:18 -0400 Subject: [PATCH] Change curl method add executable permission --- curl_execute.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/curl_execute.yaml b/curl_execute.yaml index a12be1c..0035a92 100644 --- a/curl_execute.yaml +++ b/curl_execute.yaml @@ -9,15 +9,22 @@ state: directory mode: '0755' - - name: Download scripts from remote sources - get_url: - url: "{{ item.url }}" - dest: "/tmp/downloaded_scripts/{{ item.name }}" - mode: '0755' # Make executable + - name: Download scripts using curl + command: > + curl "{{ item.url }}" -o "/tmp/downloaded_scripts/{{ item.name }}" + args: + creates: "/tmp/downloaded_scripts/{{ item.name }}" loop: - { name: 'script1.sh', url: 'https://git.nnag.me/infidel/jenkins-smo-autodeployment/raw/branch/master/test-scripts/install_k8s.sh' } register: downloaded_scripts + - name: Make downloaded scripts executable + file: + path: "/tmp/downloaded_scripts/{{ item.name }}" + mode: '0755' + loop: + - { name: 'script1.sh' } + - name: Execute downloaded scripts shell: "/tmp/downloaded_scripts/{{ item.item.name }}" loop: "{{ downloaded_scripts.results }}"