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 }}"