Sha256: 8d27e2a2efbf109a6cc1bd842ed3faa8b6fa51514318ed45ce1ca3fb9c03ba6b

Contents?: true

Size: 848 Bytes

Versions: 5

Compression:

Stored size: 848 Bytes

Contents

<%#
name: Download and execute a script
job_category: Ansible Commands
description_format: Download script from %{url} and execute it
snippet: false
template_inputs:
- name: url
  required: true
  input_type: user
  description: "URL of the script to download e.g: http://example.com/unattended/anonymous/my_script"
  advanced: false
provider_type: Ansible
kind: job_template
model: JobTemplate
%>

---
- name: "Run script"
  hosts: all
  tasks:
    - name: "Download script"
      ansible.builtin.uri:
        url: <%= input("url") %>
        return_content: true
      register: script_response
    - name: "Run script"
      ansible.builtin.shell:
        cmd: |
          {{ script_response.content }}
      register: out
      changed_when: true  # noqa: no-changed-when
    - name: "Show output"
      ansible.builtin.debug:
        var: out

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_ansible-15.0.5 app/views/foreman_ansible/job_templates/download_and_execute_script.erb
foreman_ansible-15.0.4 app/views/foreman_ansible/job_templates/download_and_execute_script.erb
foreman_ansible-15.0.3 app/views/foreman_ansible/job_templates/download_and_execute_script.erb
foreman_ansible-15.0.2 app/views/foreman_ansible/job_templates/download_and_execute_script.erb
foreman_ansible-15.0.1 app/views/foreman_ansible/job_templates/download_and_execute_script.erb